From d8659e5e5d803dd0d871ab760fa5bd65b66f7bb4 Mon Sep 17 00:00:00 2001 From: Chengwei Yang Date: Mon, 23 Sep 2013 22:21:12 +0800 Subject: [PATCH] Corret cmdline for dbus-launch started by "autolaunch:" If DBUS_BINDIR/dbus-launch start failed, then dbus-launch in $PATH will be used. However, the argv[0] is still DBUS_BINDIR/dbus-launch, then ps(1) will show you an incorrect cmdline of dbus-launch. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69716 --- dbus/dbus-sysdeps-unix.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index 09ab92a..a90fab1 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -3273,9 +3273,9 @@ _dbus_get_tmpdir(void) * @returns #TRUE on success, #FALSE if an error happened */ static dbus_bool_t -_read_subprocess_line_argv (const char *progpath, +_read_subprocess_line_argv (char *progpath, dbus_bool_t path_fallback, - char * const *argv, + char **argv, DBusString *result, DBusError *error) { @@ -3372,8 +3372,12 @@ _read_subprocess_line_argv (const char *progpath, * depends on X11). */ if (path_fallback) - /* We must have a slash, because we checked above */ - execvp (strrchr (progpath, '/')+1, argv); + { + /* We must have a slash, because we checked above */ + progpath = strrchr (progpath, '/') + 1; + argv[0] = progpath; + execvp (progpath, argv); + } } else execvp (progpath, argv); -- 1.7.9.5