aboutsummaryrefslogtreecommitdiff
path: root/monsterwm.c
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2012-06-30 19:46:07 +0300
committerIvan Kanakarakis <ivan.kanak@gmail.com>2012-07-20 18:52:16 +0300
commit00b154f690b5f40613b741e5b04d15a8a27ee7ec (patch)
tree389527cc642e8208389fd4442d847a50ac127770 /monsterwm.c
parent6c253efbb3c94baa403fe3637d70f229a4b8f253 (diff)
rework sigchld function - negate err conditional
Diffstat (limited to 'monsterwm.c')
-rw-r--r--monsterwm.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/monsterwm.c b/monsterwm.c
index aa03fe5..c3dff0a 100644
--- a/monsterwm.c
+++ b/monsterwm.c
@@ -788,9 +788,8 @@ void setup(void) {
}
void sigchld() {
- if (signal(SIGCHLD, sigchld) == SIG_ERR)
- err(EXIT_FAILURE, "cannot install SIGCHLD handler");
- while(0 < waitpid(-1, NULL, WNOHANG));
+ if (signal(SIGCHLD, sigchld) != SIG_ERR) while(0 < waitpid(-1, NULL, WNOHANG));
+ else err(EXIT_FAILURE, "cannot install SIGCHLD handler");
}
/* execute a command */