From 526973fd961ba4d5169c15962c60de22f34c59e4 Mon Sep 17 00:00:00 2001
From: Ismael Luceno <ismael@iodev.co.uk>
Date: Tue, 11 Jun 2019 22:37:06 +0200
Subject: [PATCH 12/23] shutdown: Replace sigsetmask with sigprocmask

Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
---
 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 38a9a084f529..2961d9174ba4 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 */
 
 #ifndef DEBUGGING
-- 
2.44.0

