diff --git a/src/common/spawn.c b/src/common/spawn.c index 6e8e7c51..c9b49286 100644 --- a/src/common/spawn.c +++ b/src/common/spawn.c @@ -23,6 +23,8 @@ reset_signals_and_limits(void) /* Restore ignored signals */ signal(SIGPIPE, SIG_DFL); + signal(SIGUSR1, SIG_DFL); + signal(SIGUSR2, SIG_DFL); } static bool diff --git a/src/server.c b/src/server.c index 503838cd..76a4acf5 100644 --- a/src/server.c +++ b/src/server.c @@ -328,6 +328,18 @@ server_init(struct server *server) */ signal(SIGPIPE, SIG_IGN); + /* + * Some day in the future, signal handlers may be assigned to these + * SIGUSR? signals. To give users a chance to develop extensions bound + * to these signals, make signalling labwc with SIGUSR[12] "safe" by + * ignoring these signals (as one may accidentally SIGUSR a labwc + * process not supporting such extensions). + * When signal handler assignment(s) is made, the corresponding + * signal(SIGUSR?, SIG_DFL); call(s) in spawn.c can be removed. + */ + signal(SIGUSR1, SIG_IGN); + signal(SIGUSR2, SIG_IGN); + /* * The backend is a feature which abstracts the underlying input and * output hardware. The autocreate option will choose the most suitable