]> git.tue.mpg.de Git - paraslash.git/commitdiff
Replace funny statement in para_next_signal() by readable code.
authorAndre Noll <maan@systemlinux.org>
Tue, 18 Dec 2007 07:19:29 +0000 (08:19 +0100)
committerAndre Noll <maan@systemlinux.org>
Tue, 18 Dec 2007 07:19:29 +0000 (08:19 +0100)
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

index 3d1883f5f4b65f0c01b7b8944c6afbdb0d5f717c..cc49da11f2b647c83cb068b0cecab439419eb571 100644 (file)
--- 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;
        }