From: Andre Noll Date: Tue, 18 Dec 2007 07:19:29 +0000 (+0100) Subject: Replace funny statement in para_next_signal() by readable code. X-Git-Tag: v0.3.0~45 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=21f08c693cfcbdacb7d0e0b3c29a397f5deae573;p=paraslash.git Replace funny statement in para_next_signal() by readable code. This happened to be correct only by coincidence. Quoting Linus: Assignments inside tests should probably be relegated entirely to loop constructs, where doing them outside the test changes semantics. --- diff --git a/signal.c b/signal.c index 3d1883f5..cc49da11 100644 --- a/signal.c +++ b/signal.c @@ -137,7 +137,8 @@ int para_next_signal(void) int s; ssize_t r; - if ((r = read(signal_pipe[0], &s, sizeof(s)) == sizeof(s)) > 0) { + r = read(signal_pipe[0], &s, sizeof(s)); + if (r == sizeof(s)) { PARA_DEBUG_LOG("next signal: %d\n", s); return s; }