From 21f08c693cfcbdacb7d0e0b3c29a397f5deae573 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Tue, 18 Dec 2007 08:19:29 +0100 Subject: [PATCH] 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. --- signal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.39.5