[PATCH xserver] inputthread: 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 --- os/inputthread.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/os/inputthread.c b/os/inputthread.c index 4980502..65247b4 100644 --- a/os/inputthread.c +++ b/os/inputthread.c @@ -433,12 +433,6 @@ InputThreadPreInit(void) } hotplugPipeWrite = hotplugPipe[1]; -#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 - } /** -- 2.7.4 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver] inputthread: leave the main thread's name as-is
Shouldn't glibc be fixed instead? Why punish the platforms that do it right? --Jeremy > On Oct 17, 2016, at 21:13, Peter Hutterer wrote: > > 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 > --- > os/inputthread.c | 6 -- > 1 file changed, 6 deletions(-) > > diff --git a/os/inputthread.c b/os/inputthread.c > index 4980502..65247b4 100644 > --- a/os/inputthread.c > +++ b/os/inputthread.c > @@ -433,12 +433,6 @@ InputThreadPreInit(void) > } > hotplugPipeWrite = hotplugPipe[1]; > > -#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 > - > } > > /** > -- > 2.7.4 > smime.p7s Description: S/MIME cryptographic signature ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH xserver] inputthread: leave the main thread's name as-is
On Tue, Oct 18, 2016 at 12:13:52AM -0700, Jeremy Huddleston Sequoia wrote: > Shouldn't glibc be fixed instead? Why punish the platforms that do it right? at this point I'm not sure yet whether it's glibc or the kernel but I'm betting on the latter. meanwhile, fixing this would be nice so we don't release a version where this is broken. I can #ifdef this for linux if need be. Cheers, Peter > > On Oct 17, 2016, at 21:13, Peter Hutterer wrote: > > > > 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 > > --- > > os/inputthread.c | 6 -- > > 1 file changed, 6 deletions(-) > > > > diff --git a/os/inputthread.c b/os/inputthread.c > > index 4980502..65247b4 100644 > > --- a/os/inputthread.c > > +++ b/os/inputthread.c > > @@ -433,12 +433,6 @@ InputThreadPreInit(void) > > } > > hotplugPipeWrite = hotplugPipe[1]; > > > > -#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 > > - > > } > > > > /** > > -- > > 2.7.4 > > > ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: https://lists.x.org/mailman/listinfo/xorg-devel