aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsin <sin@2f30.org>2014-02-10 14:53:51 +0000
committersin <sin@2f30.org>2014-02-10 15:00:34 +0000
commit514b100944d0b61d8e8a295ab3cd534be4cfd344 (patch)
tree3a314c6062887c88cfc84e00c4127f027216dbba
parent9246a13738fc21d08aab20382b67c5dadb4ff8ae (diff)
Unblock signals before exec
-rw-r--r--sinit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sinit.c b/sinit.c
index f40f06a..8f3b40e 100644
--- a/sinit.c
+++ b/sinit.c
@@ -26,11 +26,12 @@ static struct {
#include "config.h"
+static sigset_t set;
+
int
main(void)
{
struct signalfd_siginfo si;
- sigset_t set;
int fd;
int i;
ssize_t n;
@@ -93,6 +94,7 @@ spawn(char *const argv[])
if (pid < 0) {
weprintf("sinit: fork:");
} else if (pid == 0) {
+ sigprocmask(SIG_UNBLOCK, &set, NULL);
setsid();
setpgid(0, 0);
execvp(argv[0], argv);