From 00b154f690b5f40613b741e5b04d15a8a27ee7ec Mon Sep 17 00:00:00 2001 From: Ivan Kanakarakis Date: Sat, 30 Jun 2012 19:46:07 +0300 Subject: rework sigchld function - negate err conditional --- monsterwm.c | 5 ++--- 1 file 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 */ -- cgit v1.3.1