tree-wide: don't do assignments within if checks

Turn this:

       if ((r = foo()) < 0) { ...

into this:

       r = foo();
       if (r < 0) { ...
This commit is contained in:
Lennart Poettering
2015-09-09 08:20:20 +02:00
parent 7f6e12b033
commit 3cc2aff1ab
8 changed files with 53 additions and 19 deletions
+4 -2
View File
@@ -201,9 +201,11 @@ int fdset_cloexec(FDSet *fds, bool b) {
assert(fds);
SET_FOREACH(p, MAKE_SET(fds), i)
if ((r = fd_cloexec(PTR_TO_FD(p), b)) < 0)
SET_FOREACH(p, MAKE_SET(fds), i) {
r = fd_cloexec(PTR_TO_FD(p), b);
if (r < 0)
return r;
}
return 0;
}