According to man page, using WEXITSTATUS should be guarded by a check
of WIFEXITED, so add this check.
While at, also print an error message in case fsck was terminated
by a signal.
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
int status;
waitpid(pid, &status, 0);
- if (WEXITSTATUS(status))
+ if (WIFEXITED(status) && WEXITSTATUS(status))
ULOG_ERR("check_filesystem: %s returned %d\n", ckfs, WEXITSTATUS(status));
+ if (WIFSIGNALED(status))
+ ULOG_ERR("check_filesystem: %s terminated by %s\n", ckfs, strsignal(WTERMSIG(status)));
}
}