diff options
author | Mattias Andrée <maandree@member.fsf.org> | 2015-12-29 15:24:39 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@member.fsf.org> | 2015-12-29 15:24:39 +0100 |
commit | 4cc637948552123652d0546d8b93cf5f17a690e0 (patch) | |
tree | f8e6cd717ea8c46cc6e26c2c76e7d087397321cf /src/satd-diminished.c | |
parent | receive messsage from daemon (diff) | |
download | sat-4cc637948552123652d0546d8b93cf5f17a690e0.tar.gz sat-4cc637948552123652d0546d8b93cf5f17a690e0.tar.bz2 sat-4cc637948552123652d0546d8b93cf5f17a690e0.tar.xz |
...
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-rw-r--r-- | src/satd-diminished.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/satd-diminished.c b/src/satd-diminished.c index 65f6d31..18f65d8 100644 --- a/src/satd-diminished.c +++ b/src/satd-diminished.c @@ -52,14 +52,10 @@ static volatile sig_atomic_t received_signo = 0; static void sighandler(int signo) { int saved_errno = errno; - switch (signo) { - case SIGCHLD: + if (signo == SIGCHLD) waitpid(-1, NULL, WNOHANG); - break; - default: + else received_signo = (sig_atomic_t)signo; - break; - } errno = saved_errno; } @@ -95,8 +91,7 @@ accept_again: perror(argv[0]); } received_signo = 0; - fd = accept(SOCK_FILENO, NULL, NULL); - if (fd == -1) { + if (fd = accept(SOCK_FILENO, NULL, NULL), fd == -1) { switch (errno) { case ECONNABORTED: case EINTR: |