mirror of
https://github.com/troglobit/finit.git
synced 2026-10-14 10:19:36 +00:00
Fix WIFEXITED() logic when collecting reaped processes
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
3ce5a2a965
commit
be9d54561d
2 files changed
+8
-10
No files matched your search
+3
-5
@@ -484,7 +484,6 @@ int run_parts(char *dir, char *cmd, const char *env[], int progress)
|
||||
};
|
||||
pid_t pid = 0;
|
||||
int status;
|
||||
int exit_status;
|
||||
|
||||
paste(path, sizeof(path), dir, name);
|
||||
if (stat(path, &st)) {
|
||||
@@ -521,13 +520,12 @@ int run_parts(char *dir, char *cmd, const char *env[], int progress)
|
||||
}
|
||||
|
||||
status = complete(path, pid);
|
||||
exit_status = WEXITSTATUS(status);
|
||||
if (WIFEXITED(status) && exit_status)
|
||||
warnx("%s exited with status %d", path, exit_status);
|
||||
if (WIFEXITED(status))
|
||||
warnx("%s exited with status %d", path, WEXITSTATUS(status));
|
||||
else if (WIFSIGNALED(status))
|
||||
warnx("%s terminated by signad %d", path, WTERMSIG(status));
|
||||
if (progress)
|
||||
print_result(status);
|
||||
print_result(WEXITSTATUS(status));
|
||||
}
|
||||
|
||||
while (num--)
|
||||
|
||||
Reference in new issue
Block a user