commit f10579d4ac330f0d78d15f4c8010da64a0dbd537
parent 6331c0bf4e3ac2afda4e1706262f4c851333c798
Author: aabacchus <ben@bvnf.space>
Date: Sun, 15 May 2022 19:56:03 +0100
build-page.c: check exit status of child
If execvp in the child fails, it returns 126 but the parent only checks
if the child terminated normally. Also check for a non-zero exit status.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/build-page.c b/build-page.c
@@ -93,7 +93,7 @@ int spawn_wait(char **argv) {
if (wait(&status) == -1)
return -1;
- return WIFEXITED(status) ? 0 : -1;
+ return WIFEXITED(status) ? WEXITSTATUS(status) ? -1 : 0 : -1;
}
void print_name(const char *name) {