diff options
author | Ben Pfaff <blp@nicira.com> | 2011-03-31 16:23:50 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2011-04-04 10:58:55 -0700 |
commit | 279c9e030818e039bb1c26be76e2cc1e8f6b13a6 (patch) | |
tree | d0b34b231861a6611ebe227326365c778aa3eac8 /lib/process.c | |
parent | fcaddd4dd1e8feefc09ea2664ad51fb669d136f8 (diff) |
Log anything that could prevent a daemon from starting.
If a daemon doesn't start, we need to know why. Being able to
consistently consult the log to find out is helpful.
Diffstat (limited to 'lib/process.c')
-rw-r--r-- | lib/process.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/lib/process.c b/lib/process.c index f772833d..55092f50 100644 --- a/lib/process.c +++ b/lib/process.c @@ -82,9 +82,7 @@ process_init(void) inited = true; /* Create notification pipe. */ - if (pipe(fds)) { - ovs_fatal(errno, "could not create pipe"); - } + xpipe(fds); set_nonblocking(fds[0]); set_nonblocking(fds[1]); @@ -93,9 +91,7 @@ process_init(void) sa.sa_handler = sigchld_handler; sigemptyset(&sa.sa_mask); sa.sa_flags = SA_NOCLDSTOP | SA_RESTART; - if (sigaction(SIGCHLD, &sa, NULL)) { - ovs_fatal(errno, "sigaction(SIGCHLD) failed"); - } + xsigaction(SIGCHLD, &sa, NULL); } char * @@ -638,9 +634,8 @@ static bool sigchld_is_blocked(void) { sigset_t sigs; - if (sigprocmask(SIG_SETMASK, NULL, &sigs)) { - ovs_fatal(errno, "sigprocmask"); - } + + xsigprocmask(SIG_SETMASK, NULL, &sigs); return sigismember(&sigs, SIGCHLD); } @@ -648,17 +643,14 @@ static void block_sigchld(sigset_t *oldsigs) { sigset_t sigchld; + sigemptyset(&sigchld); sigaddset(&sigchld, SIGCHLD); - if (sigprocmask(SIG_BLOCK, &sigchld, oldsigs)) { - ovs_fatal(errno, "sigprocmask"); - } + xsigprocmask(SIG_BLOCK, &sigchld, oldsigs); } static void unblock_sigchld(const sigset_t *oldsigs) { - if (sigprocmask(SIG_SETMASK, oldsigs, NULL)) { - ovs_fatal(errno, "sigprocmask"); - } + xsigprocmask(SIG_SETMASK, oldsigs, NULL); } |