mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-26 08:15:24 +00:00
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>
This commit is contained in:
@@ -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
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user