Use die() instead of fprintf+exit

This commit is contained in:
Quentin Rameau 2017-07-24 00:31:01 +02:00 committed by Laslo Hunhold
parent 820f644fe3
commit 0fed1d5bd2

View file

@ -1023,9 +1023,7 @@ main(int argc, char *argv[])
/* raise the process limit */ /* raise the process limit */
rlim.rlim_cur = rlim.rlim_max = maxnprocs; rlim.rlim_cur = rlim.rlim_max = maxnprocs;
if (setrlimit(RLIMIT_NPROC, &rlim) < 0) { if (setrlimit(RLIMIT_NPROC, &rlim) < 0) {
fprintf(stderr, "%s: setrlimit RLIMIT_NPROC: %s\n", argv0, die("%s: setrlimit RLIMIT_NPROC: %s\n", argv0, strerror(errno));
strerror(errno));
return 1;
} }
/* validate user and group */ /* validate user and group */
@ -1049,9 +1047,8 @@ main(int argc, char *argv[])
case 0: case 0:
/* reap children automatically */ /* reap children automatically */
if (signal(SIGCHLD, SIG_IGN) == SIG_ERR) { if (signal(SIGCHLD, SIG_IGN) == SIG_ERR) {
fprintf(stderr, "%s: signal: Failed to set SIG_IGN on" die("%s: signal: Failed to set SIG_IGN on SIGCHLD\n",
"SIGCHLD\n", argv0); argv0);
return 1;
} }
/* chroot */ /* chroot */