Commit 7096bef6d89562fdd86a541686ca4f51e0f60f82
Shorten waitpid code
cel committed on 10/28/2016, 3:26:06 AMParent: f87af6a0bf824e4980c8e1b25a7a1307183bbe3e
Files changed
ccdl.c | changed |
ccdl.c | |||
---|---|---|---|
@@ -53,15 +53,11 @@ | |||
53 | 53 … | if (execvp(argv[0], argv)) err(1, "execvp"); | |
54 | 54 … | exit(0); | |
55 | 55 … | } else { | |
56 | 56 … | int wstatus; | |
57 | - if (waitpid(child, &wstatus, 0) < 0) { | ||
58 | - return -1; | ||
59 | - } else if (WIFEXITED(wstatus) && WEXITSTATUS(wstatus) == 0) { | ||
60 | - return 0; | ||
61 | - } else { | ||
62 | - return -1; | ||
63 | - } | ||
57 … | + if (waitpid(child, &wstatus, 0) < 0) return -1; | ||
58 … | + if (!WIFEXITED(wstatus) || WEXITSTATUS(wstatus)) return -1; | ||
59 … | + return 0; | ||
64 | 60 … | } | |
65 | 61 … | } | |
66 | 62 … | ||
67 | 63 … | static int lib_build(struct lib *lib) | |
Built with git-ssb-web