[Xfce4-commits] <xfce4-panel:devel> * Change the process name of the wrapper to panel-{plugin_name}.
Nick Schermer
nick at xfce.org
Tue Aug 11 20:24:10 CEST 2009
Updating branch refs/heads/devel
to 405cff281441b6a12f92f088217c0cd74077cd57 (commit)
from 2f49c1b0b68e985d7cfd4d90e756e6151cbc4f57 (commit)
commit 405cff281441b6a12f92f088217c0cd74077cd57
Author: Nick Schermer <nick at xfce.org>
Date: Tue Aug 26 22:34:39 2008 +0200
* Change the process name of the wrapper to panel-{plugin_name}.
configure.in.in | 2 +-
wrapper/main.c | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/configure.in.in b/configure.in.in
index 2d90a12..bfb15d1 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -83,7 +83,7 @@ dnl *** Check for standard headers ***
dnl **********************************
AC_HEADER_STDC()
AC_CHECK_HEADERS([stdlib.h unistd.h locale.h stdio.h errno.h time.h string.h \
- math.h sys/types.h sys/wait.h memory.h signal.h])
+ math.h sys/types.h sys/wait.h memory.h signal.h sys/prctl.h])
dnl ******************************
dnl *** Check for i18n support ***
diff --git a/wrapper/main.c b/wrapper/main.c
index 50f7d3c..00334c1 100644
--- a/wrapper/main.c
+++ b/wrapper/main.c
@@ -21,6 +21,9 @@
#include <config.h>
#endif
+#ifdef HAVE_SYS_PRCTL_H
+#include <sys/prctl.h>
+#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
@@ -224,6 +227,7 @@ main (gint argc, gchar **argv)
DBusConnection *dbus_connection;
DBusGProxy *dbus_gproxy;
WrapperPlug *plug;
+ gchar process_name[16];
/* set translation domain */
xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
@@ -275,6 +279,10 @@ main (gint argc, gchar **argv)
return EXIT_FAILURE;
}
+ /* change the process name to something that makes sence */
+ g_snprintf (process_name, sizeof (process_name), "panel-%s", opt_name);
+ prctl (PR_SET_NAME, (gulong) process_name, 0, 0, 0);
+
/* try to connect to dbus */
dbus_gconnection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
if (G_UNLIKELY (dbus_gconnection == NULL))
More information about the Xfce4-commits
mailing list