summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2016-10-26 12:21:16 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2016-10-27 09:53:01 +1000
commit5cb328338684d8e5b03913c47475bfcd7acffec4 (patch)
treec5c6b65991700121ebf7c790eff5f3ed16d56fde
parent007f8ee61a35ceda36b43e772a9a1074b8e27a06 (diff)
inputthread: On Linux leave the main thread's name as-is
On Linux, setting the main thread's name changes the program name (/proc/self/comm). Setting it to MainThread breaks scripts that rely on the command name, e.g. ps -C Xorg. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--os/inputthread.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/os/inputthread.c b/os/inputthread.c
index ddafa7fe8..8e7f2edb9 100644
--- a/os/inputthread.c
+++ b/os/inputthread.c
@@ -431,11 +431,13 @@ InputThreadPreInit(void)
}
hotplugPipeWrite = hotplugPipe[1];
+#ifndef __linux__ /* Linux does not deal well with renaming the main thread */
#if defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID)
pthread_setname_np (pthread_self(), "MainThread");
#elif defined(HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID)
pthread_setname_np ("MainThread");
#endif
+#endif
}