[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdelibs/kinit
From: Dirk Mueller <mueller () kde ! org>
Date: 2004-09-26 1:09:39
Message-ID: 20040926010939.E57569192 () office ! kde ! org
[Download RAW message or body]
CVS commit by mueller:
set the process name on linux, so that killall works correctly and you
don't need ugly hacks like kdekillall.
I'd like to backport this.. any objections?
M +12 -1 kinit.cpp 1.143
--- kdelibs/kinit/kinit.cpp #1.142:1.143
@@ -60,4 +60,11 @@
#include <klocale.h>
+#ifdef Q_OS_LINUX
+#include <sys/prctl.h>
+#ifndef PR_SET_NAME
+#define PR_SET_NAME 15
+#endif
+#endif
+
#if defined Q_WS_X11 && ! defined K_WS_QTONLY
#include <kstartupinfo.h> // schroder
@@ -508,4 +515,8 @@ static pid_t launch(int argc, const char
/** Give the process a new name **/
kdeinit_setproctitle( "%s", procTitle.data() );
+#ifdef Q_OS_LINUX
+ /* set the process name, so that killall works like intended */
+ prctl(PR_SET_NAME, (unsigned long) name.data(), 0, 0, 0);
+#endif
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic