}
}
- pid = fork();
- if (pid < 0) {
- r = log_error_errno(errno, "fork(): %m");
+ r = safe_fork("(fsck)", FORK_RESET_SIGNALS|FORK_DEATHSIG, &pid);
+ if (r < 0) {
+ log_error_errno(r, "fork(): %m");
goto finish;
}
- if (pid == 0) {
+ if (r == 0) {
char dash_c[STRLEN("-C") + DECIMAL_STR_MAX(int) + 1];
int progress_socket = -1;
const char *cmdline[9];
/* Child */
- (void) reset_all_signal_handlers();
- (void) reset_signal_mask();
- assert_se(prctl(PR_SET_PDEATHSIG, SIGTERM) == 0);
-
/* Close the reading side of the progress pipe */
progress_pipe[0] = safe_close(progress_pipe[0]);