summaryrefslogtreecommitdiff
path: root/wrapper
diff options
context:
space:
mode:
authorNick Schermer <nick@xfce.org>2010-02-26 14:08:10 +0100
committerNick Schermer <nick@xfce.org>2010-02-26 14:11:33 +0100
commit157a725c6650eba5711b89918f44bef28dbf9c1f (patch)
tree6da78e5334bd91a7dcfd2e4eecf2b3098d2067fa /wrapper
parent79837facd3c496b4ea8ee0d38bab21697fdc141e (diff)
Improve changing the process name of the wrapper a bit.
Hopefully it will make less trouble on the platforms with support for the prctl call.
Diffstat (limited to 'wrapper')
-rw-r--r--wrapper/main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/wrapper/main.c b/wrapper/main.c
index 4078798b..6c5418b2 100644
--- a/wrapper/main.c
+++ b/wrapper/main.c
@@ -198,7 +198,9 @@ main (gint argc, gchar **argv)
DBusConnection *dbus_connection;
DBusGProxy *dbus_gproxy;
WrapperPlug *plug;
+#if defined(HAVE_SYS_PRCTL_H) && defined(PR_SET_NAME)
gchar process_name[16];
+#endif
/* set translation domain */
xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
@@ -250,9 +252,12 @@ main (gint argc, gchar **argv)
return EXIT_FAILURE;
}
+#if defined(HAVE_SYS_PRCTL_H) && defined(PR_SET_NAME)
/* change the process name to something that makes sence */
g_snprintf (process_name, sizeof (process_name), "panel-%s-%d", wrapper_name, opt_unique_id);
- prctl (PR_SET_NAME, (gulong) process_name, 0, 0, 0);
+ if (prctl (PR_SET_NAME, (gulong) process_name, 0, 0, 0) == -1)
+ g_critical ("Failed to set the process name to %s", process_name);
+#endif
/* try to connect to dbus */
dbus_gconnection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);