git ssb

0+

cel / foostudio



Commit 7096bef6d89562fdd86a541686ca4f51e0f60f82

Shorten waitpid code

cel committed on 10/28/2016, 3:26:06 AM
Parent: f87af6a0bf824e4980c8e1b25a7a1307183bbe3e

Files changed

ccdl.cchanged
ccdl.cView
@@ -53,15 +53,11 @@
5353 if (execvp(argv[0], argv)) err(1, "execvp");
5454 exit(0);
5555 } else {
5656 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;
6460 }
6561 }
6662
6763 static int lib_build(struct lib *lib)

Built with git-ssb-web