From 63710dafab6b84204ab7a8c7001bcbe3c22b033f Mon Sep 17 00:00:00 2001 From: Ismael Luceno Date: Tue, 11 Jun 2019 22:37:06 +0200 Subject: [PATCH] shutdown: Replace sigsetmask with sigprocmask Signed-off-by: Ismael Luceno --- login-utils/shutdown.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/login-utils/shutdown.c b/login-utils/shutdown.c index 5b68a618d76a..202e12e1f08e 100644 --- a/login-utils/shutdown.c +++ b/login-utils/shutdown.c @@ -195,7 +195,13 @@ main(int argc, char *argv[]) for (fd = 0; fd < 3; fd++) close (fd); while (1) wait (NULL); /* Grim reaper never stops */ } - sigsetmask (0); /* simpleinit(8) blocks all signals: undo for ALRM */ + /* simpleinit(8) blocks all signals: undo for ALRM */ + { + sigset_t n; + sigemptyset(&n); + sigaddset(&n, SIGALRM); + sigprocmask(SIG_UNBLOCK, &n, NULL); + } for (i = 1; i < NSIG; i++) signal (i, SIG_DFL); /* unnecessary */ setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); -- 2.21.0