diff options
Diffstat (limited to 'src/quotacheck/quotacheck.c')
-rw-r--r-- | src/quotacheck/quotacheck.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/quotacheck/quotacheck.c b/src/quotacheck/quotacheck.c index ec5be21a34..b5636e69d4 100644 --- a/src/quotacheck/quotacheck.c +++ b/src/quotacheck/quotacheck.c @@ -106,19 +106,15 @@ int main(int argc, char *argv[]) { return EXIT_SUCCESS; } - pid = fork(); - if (pid < 0) { - r = log_error_errno(errno, "fork(): %m"); + r = safe_fork("(quotacheck)", FORK_RESET_SIGNALS|FORK_DEATHSIG, &pid); + if (r < 0) { + log_error_errno(r, "fork(): %m"); goto finish; } - if (pid == 0) { + if (r == 0) { /* Child */ - (void) reset_all_signal_handlers(); - (void) reset_signal_mask(); - assert_se(prctl(PR_SET_PDEATHSIG, SIGTERM) == 0); - execv(cmdline[0], (char**) cmdline); _exit(1); /* Operational error */ } |