From 5cb328338684d8e5b03913c47475bfcd7acffec4 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 26 Oct 2016 12:21:16 +0200 Subject: [PATCH] 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 Signed-off-by: Hans de Goede --- os/inputthread.c | 2 ++ 1 file changed, 2 insertions(+) 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 }