break;
case 'V':
print_version();
- exit(0);
+ exit(EXIT_SUCCESS);
case 'h':
print_usage();
- exit(0);
+ exit(EXIT_SUCCESS);
case '?':
fprintf(stderr, "%s: invalid option: %c\n",
program_name, optopt);
if (pid != 0)
{
/* parent */
- exit(0);
+ exit(EXIT_SUCCESS);
}
else
{
got_sigusr1 = 0;
wait_children();
explain("Exited");
- exit(0);
+ exit(EXIT_SUCCESS);
}
static void
if (sigprocmask(0, NULL, &old_sigmask)) die_e("sigset error");
if (fclose(stdin)) die_e("Can't close stdin");
- xopen(0, "/dev/null", O_RDONLY);
+ xopen(STDIN_FILENO, "/dev/null", O_RDONLY);
if (!no_daemon && !testing_only)
go_background();
if (testing_only)
{
- if (complaints) exit (1);
+ if (complaints) exit (EXIT_FAILURE);
- exit (0);
+ exit (EXIT_SUCCESS);
}
if (update_only)
{
fake_jobs();
- exit(0);
+ exit(EXIT_SUCCESS);
}
explain_intentions();
}
wait_children();
explain("Normal exit (%d job%s run)", njobs, njobs == 1 ? "" : "s");
- exit(0);
+ exit(EXIT_SUCCESS);
}
/* child */
in_background = 1;
/* set stdin to the job's output */
- xclose(0);
- if (dup2(jr->input_fd, 0) != 0) die_e("Can't dup2()");
- if (lseek(0, 0, SEEK_SET) != 0) die_e("Can't lseek()");
+ xclose(STDIN_FILENO);
+ if (dup2(jr->input_fd, STDIN_FILENO) != 0) die_e("Can't dup2()");
+ if (lseek(STDIN_FILENO, 0, SEEK_SET) != 0) die_e("Can't lseek()");
umask(old_umask);
if (sigprocmask(SIG_SETMASK, &old_sigmask, NULL))
die_e("sigprocmask error");
xcloselog();
/* Ensure stdout/stderr are sane before exec-ing sendmail */
- xclose(1); xopen(1, "/dev/null", O_WRONLY);
- xclose(2); xopen(2, "/dev/null", O_WRONLY);
+ xclose(STDOUT_FILENO); xopen(STDOUT_FILENO, "/dev/null", O_WRONLY);
+ xclose(STDERR_FILENO); xopen(STDERR_FILENO, "/dev/null", O_WRONLY);
xclose(jr->output_fd);
/* Ensure stdin is not appendable ... ? */