This has fixed the hanging processes on my laptop. On Tue, Oct 24, 2017 at 11:55 AM, Luca Castagnini < [email protected]> wrote:
> Hi guys, > > syndaemon goes into an infinite loop whenever it receives a SIGINT signal. > An explanation and a patch are proposed below. > > In the file: > xenocara/driver/xf86-input-synaptics/tools/syndaemon.c > the program uses a signal handling function which in turn calls > kill(getpid(), signum), thus resulting in a loop. > This actually happens for all the signals: SIGHUP, SIGINT, SIGQUIT, SIGILL, > ... > as they are all caught with the same signal_handler() function. > > Under Linux the following flag would be set: > act.sa_flags = SA_ONESHOT; > and the handling function would run only once. > > SA_ONESHOT is a (linux only?) obsolete equivalent to SA_RESETHAND. > The patch below replaces SA_ONESHOT with SA_RESETHAND and removes the > problem. > > Cheers, > Luca > > > Index: driver/xf86-input-synaptics/tools/syndaemon.c > =================================================================== > RCS file: /cvs/xenocara/driver/xf86-input-synaptics/tools/syndaemon.c,v > retrieving revision 1.5 > diff -u -p -r1.5 syndaemon.c > --- driver/xf86-input-synaptics/tools/syndaemon.c 22 Jan 2017 > 09:54:53 -0000 1.5 > +++ driver/xf86-input-synaptics/tools/syndaemon.c 24 Oct 2017 > 12:16:40 -0000 > @@ -173,8 +173,8 @@ install_signal_handler(void) > sigemptyset(&set); > act.sa_handler = signal_handler; > act.sa_mask = set; > -#ifdef SA_ONESHOT > - act.sa_flags = SA_ONESHOT; > +#ifdef SA_RESETHAND > + act.sa_flags = SA_RESETHAND; > #else > act.sa_flags = 0; > #endif >
