commit 8cae8e4f31cd38b441bc583c8038d212be7b5db8
parent d905d8c95e9d61cca2bc751183c599a4186f4691
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Sun, 20 Dec 2020 20:51:45 -0800
Exit nonzero on wait(2) error in efmt
Diffstat:
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/main.c b/main.c
@@ -315,12 +315,13 @@ efmt(int (*putter)(const char *, int, const char **), const char *path, int argc
_exit(putter(path, argc, argv));
}
+ close(fds[0]); /* NOTE: errors not checked */
+ close(fds[1]);
for (i = 0; i < 2; ++i)
- close(fds[i]);
- for (i = 0; i < 2; ++i) {
- if (wait(0) == -1)
+ if (wait(0) == -1) {
warn("unable to wait");
- }
+ return 1;
+ }
return 0;
}