]> granicus.if.org Git - strace/blobdiff - test/procpollable.c
Improve code readability by avoiding assignments inside if()
[strace] / test / procpollable.c
index a841af147c9eb3f118fe76b71567628bac7c64d4..7bc5efafdf73c5d32784d8193a1b82522ea780a6 100644 (file)
@@ -12,14 +12,16 @@ int main(int argc, char *argv[])
        FILE *pfp;
        struct pollfd pfd;
 
-       if ((pid = fork()) == 0) {
+       pid = fork();
+       if (pid == 0) {
                pause();
                exit(0);
        }
 
        sprintf(proc, "/proc/%d", pid);
 
-       if ((pfp = fopen(proc, "r+")) == NULL)
+       pfp = fopen(proc, "r+");
+       if (pfp == NULL)
                goto fail;
 
        if (ioctl(fileno(pfp), PIOCSTOP, NULL) < 0)