Commit 4cfce6d6 authored by Andreas Henriksson's avatar Andreas Henriksson

New upstream version 1.5.2

parent e5575af6
......@@ -6,6 +6,7 @@ anacron/Makefile
anacron/Makefile.in
aclocal.m4
autom4te.cache
compile
config.guess
config.h
config.h.in
......@@ -24,6 +25,9 @@ tags
*.o
src/crond
src/crontab
src/cronnext
src/cron-paths.h
*~
*.tar.*
*.orig
*.patch
Original vixie-cron was written by Paul Vixie.
Significant contributors:
Marcela Mašláňová <mmaslano@redhat.com>
Colin Dean <colin@colin-dean.org>
Tomáš Mráz <tmraz@fedoraproject.org>
Marco Migliori <sgerwk@aol.com>
Sami Kerola <kerolasa@iki.fi>
This diff is collapsed.
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
......@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
......@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
......@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
......@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
......@@ -225,7 +225,7 @@ impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
......@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
......@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
......@@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -303,17 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
......@@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names:
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
This diff is collapsed.
SUBDIRS = src man
if ANACRON
SUBDIRS += anacron
endif
SUBDIRS = src man anacron
dist_noinst_HEADERS = \
cronie_common.h
EXTRA_DIST = \
cronie.init \
crond.sysconfig \
contrib/anacrontab \
contrib/0anacron \
contrib/0hourly \
contrib/dailyjobs \
contrib/cronie.systemd \
anacron/ChangeLog.anacron
if PAM
pamdir = $(sysconfdir)/pam.d
dist_pam_DATA = pam/crond
else
EXTRA_DIST += pam/crond
endif
EXTRA_DIST = cronie.init crond.sysconfig contrib/anacrontab \
contrib/0anacron contrib/0hourly \
contrib/dailyjobs
cronie NEWS -- history of user-visible changes.
Release 1.5.2
* cronnext: New useful utility to find out time of the next job run.
* crond: Avoid creating PID files when crond doesn't fork.
* crontab: Do not try to replace the crontab with a directory.
* crond: Log startup even when started in non-forking mode.
* Multiple small cleanups and fixes.
Release 1.5.1
* crontab: Use temporary file name that is ignored by crond.
* crond: Inherit PATH from the crond environment if -P option is used.
* crond: Remove hardcoded "system_u" SELinux user, use the SELinux user
of the running crond.
* anacron: Small cleanups and fixes.
* crond: Fix longstanding race condition on repeated crontab modification.
Release 1.5.0
* First release with NEWS. :)
* crond: Job environment variables are set also when executing sendmail.
* crond: Adding duplicate orphans on reload is now prevented.
* crond: The regular crond shutdown is now logged.
* crontab: PAM is not called in crontab command if the caller's uid is 0.
* crond: PAM is not called from crond for system cron jobs
(/etc/crontab, /etc/cron.d) which are run for uid 0.
* crond: The existence of an user is checked at time when job is run
and not when the crontab is parsed on database reload.
# Makefile.am - two binaries crond and crontab
if ANACRON
sbin_PROGRAMS = anacron
endif
anacron_SOURCES = \
gregor.c lock.c log.c main.c matchrx.c readtab.c runjob.c \
......@@ -9,6 +11,7 @@ common_nodist = anacron-paths.h
nodist_anacron_SOURCES = $(common_nodist)
BUILT_SOURCES = $(common_nodist)
AM_CFLAGS = -I$(top_srcdir)
LDADD = $(LIBSELINUX) $(LIBPAM) $(LIBAUDIT)
......
......@@ -14,9 +14,9 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
The GNU General Public License can also be found in the file
`COPYING' that comes with the Anacron source distribution.
......@@ -44,6 +44,7 @@
#include <signal.h>
#include <time.h>
#include "anacron-paths.h"
#include "cronie_common.h"
/* Some declarations */
......@@ -67,7 +68,7 @@ struct job_rec1 {
int timestamp_fd;
int input_fd;
int output_fd;
int mail_header_size;
off_t mail_header_size;
pid_t job_pid;
pid_t mailer_pid;
int drop_job;
......@@ -93,8 +94,8 @@ extern int in_background;
extern job_rec *first_job_rec;
extern env_rec *first_env_rec;
extern char **args;
extern int nargs;
extern char **job_args;
extern int job_nargs;
extern int njobs;
extern job_rec **job_array;
......@@ -109,6 +110,9 @@ extern time_t start_sec;
extern int range_start;
extern int range_stop;
/* preferred hour for jobs */
extern int preferred_hour;
/* Function prototypes */
/* main.c */
......@@ -128,8 +132,8 @@ void explain(const char *fmt, ...)PRINTF_FORMAT(1,2);
void explain_e(const char *fmt, ...)PRINTF_FORMAT(1,2);
void complain(const char *fmt, ...)PRINTF_FORMAT(1,2);
void complain_e(const char *fmt, ...)PRINTF_FORMAT(1,2);
void die(const char *fmt, ...)PRINTF_FORMAT(1,2);
void die_e(const char *fmt, ...)PRINTF_FORMAT(1,2);
void die(const char *fmt, ...)PRINTF_FORMAT(1,2) ATTRIBUTE_NORETURN;
void die_e(const char *fmt, ...)PRINTF_FORMAT(1,2) ATTRIBUTE_NORETURN;
void xdebug(const char *fmt, ...)PRINTF_FORMAT(1,2);
void xdebug_e(const char *fmt, ...)PRINTF_FORMAT(1,2);
void xcloselog(void);
......
......@@ -3,20 +3,20 @@
Copyright (C) 1998 Itai Tzur <itzur@actcom.co.il>
Copyright (C) 1999 Sean 'Shaleh' Perry <shaleh@debian.org>
Copyright (C) 2004 Pascal Hakim <pasc@redellipse.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
The GNU General Public License can also be found in the file
`COPYING' that comes with the Anacron source distribution.
......
......@@ -14,9 +14,9 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
The GNU General Public License can also be found in the file
`COPYING' that comes with the Anacron source distribution.
......
......@@ -3,20 +3,20 @@
Copyright (C) 1998 Itai Tzur <itzur@actcom.co.il>
Copyright (C) 1999 Sean 'Shaleh' Perry <shaleh@debian.org>
Copyirght (C) 2004 Pascal Hakim <pasc@redellipse.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
The GNU General Public License can also be found in the file
`COPYING' that comes with the Anacron source distribution.
......@@ -129,7 +129,7 @@ consider_job(job_rec *jr)
period = days_last_month ();
bypass = days_this_month ();
break;
case 2: /* yearly, annualy */
case 2: /* yearly, annually */
period = days_last_year ();
bypass = days_this_year ();
break;
......@@ -156,6 +156,12 @@ consider_job(job_rec *jr)
jobtime = start_sec + jr->delay * 60;
t = localtime(&jobtime);
if (!now && preferred_hour != -1 && t->tm_hour != preferred_hour) {
Debug(("The job's %s preferred hour %d was missed, skipping the job.", jr->ident, preferred_hour));
xclose (jr->timestamp_fd);
return 0;
}
if (!now && range_start != -1 && range_stop != -1 &&
(t->tm_hour < range_start || t->tm_hour >= range_stop))
{
......
......@@ -3,20 +3,20 @@
Copyright (C) 1998 Itai Tzur <itzur@actcom.co.il>
Copyright (C) 1999 Sean 'Shaleh' Perry <shaleh@debian.org>
Copyright (C) 2004 Pascal Hakim <pasc@redellipse.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
The GNU General Public License can also be found in the file
`COPYING' that comes with the Anacron source distribution.
......@@ -54,7 +54,7 @@ static int log_open = 0;
int complaints = 0;
static void
xopenlog()
xopenlog(void)
{
if (!log_open)
{
......@@ -64,7 +64,7 @@ xopenlog()
}
void
xcloselog()
xcloselog(void)
{
if (log_open) closelog();
log_open = 0;
......
......@@ -3,25 +3,26 @@
Copyright (C) 1998 Itai Tzur <itzur@actcom.co.il>
Copyright (C) 1999 Sean 'Shaleh' Perry <shaleh@debian.org>
Copyright (C) 2004 Pascal Hakim <pasc@redellipse.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
The GNU General Public License can also be found in the file
`COPYING' that comes with the Anacron source distribution.
*/
#include "config.h"
#include <time.h>
#include <sys/time.h>
......@@ -36,6 +37,7 @@
#include <locale.h>
#include "global.h"
#include "gregor.h"
#include "cronie_common.h"
pid_t primary_pid;
int day_now;
......@@ -46,11 +48,10 @@ char *anacrontab;
char *spooldir;
int serialize, force, update_only, now,
no_daemon, quiet, testing_only; /* command-line options */
char **args; /* vector of "job" command-line arguments */
int nargs; /* number of these */
char **job_args; /* vector of "job" command-line arguments */
int job_nargs; /* number of these */
char *defarg = "*";
int in_background; /* are we in the background? */
int old_umask; /* umask when started */
sigset_t old_sigmask; /* signal mask when started */
job_rec *first_job_rec;
......@@ -61,41 +62,39 @@ static volatile int got_sigalrm, got_sigchld, got_sigusr1;
int running_jobs, running_mailers; /* , number of */
int range_start = -1;
int range_stop = -1;
int preferred_hour = -1;
static void
print_version()
print_version(void)
{
printf("Anacron \n"
printf("Anacron from project %s\n"
"Copyright (C) 1998 Itai Tzur <itzur@actcom.co.il>\n"
"Copyright (C) 1999 Sean 'Shaleh' Perry <shaleh@debian.org>\n"
"Copyright (C) 2004 Pascal Hakim <pasc@redellipse.net>\n"
"\n"
"Mail comments, suggestions and bug reports to <pasc@redellipse.net>."
"\n\n");
"\n\n", PACKAGE_STRING);
}
static void
print_usage()
print_usage(void)
{
printf("Usage: anacron [-s] [-f] [-n] [-d] [-q] [-t anacrontab] [-S spooldir] [job] ...\n"
" anacron [-S spooldir] -u [job] ...\n"
" anacron [-V|-h]\n"
" anacron -T [-t anacrontab]\n"
"\n"
" -s Serialize execution of jobs\n"
" -f Force execution of jobs, even before their time\n"
" -n Run jobs with no delay, implies -s\n"
" -d Don't fork to the background\n"
" -q Suppress stderr messages, only applicable with -d\n"
" -u Update the timestamps without actually running anything\n"
" -t Use this anacrontab\n"
" -V Print version information\n"
" -h Print this message\n"
" -T Test an anacrontab\n"
" -S Select a different spool directory\n"
"\n"
"See the manpage for more details.\n"
"\n");
printf("Usage:\n");
printf(" %s [options] [job] ...\n", program_name);
printf(" %s -T [-t anacrontab-file]\n", program_name);
printf("\nOptions:\n");
printf(" -s Serialize execution of jobs\n");
printf(" -f Force execution of jobs, even before their time\n");
printf(" -n Run jobs with no delay, implies -s\n");
printf(" -d Don't fork to the background\n");
printf(" -q Suppress stderr messages, only applicable with -d\n");
printf(" -u Update the timestamps without actually running anything\n");
printf(" -V Print version information\n");
printf(" -h Print this message\n");
printf(" -t <file> Use alternative anacrontab\n");
printf(" -T Test an anacrontab\n");
printf(" -S <dir> Select a different spool directory\n");
printf("\nSee the anacron(8) manpage for more details.\n");
}
static void
......@@ -139,10 +138,10 @@ parse_opts(int argc, char *argv[])
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);
......@@ -154,18 +153,18 @@ parse_opts(int argc, char *argv[])
if (optind == argc)
{
/* no arguments. Equivalent to: `*' */
nargs = 1;
args = &defarg;
job_nargs = 1;
job_args = &defarg;
}
else
{
nargs = argc - optind;
args = argv + optind;
job_nargs = argc - optind;
job_args = argv + optind;
}
}
pid_t
xfork()
xfork(void)
/* Like fork(), only never returns on failure */
{
pid_t pid;
......@@ -201,7 +200,7 @@ xclose(int fd)
}
static void
go_background()
go_background(void)
/* Become a daemon. The foreground process exits successfully. */
{
pid_t pid;
......@@ -218,7 +217,7 @@ go_background()
if (pid != 0)
{
/* parent */
exit(0);
exit(EXIT_SUCCESS);
}
else
{
......@@ -229,26 +228,26 @@ go_background()
}
}
void
handle_sigalrm()
static void
handle_sigalrm(int unused ATTRIBUTE_UNUSED)
{
got_sigalrm = 1;
}
void
handle_sigchld()
static void
handle_sigchld(int unused ATTRIBUTE_UNUSED)
{
got_sigchld = 1;
}
void
handle_sigusr1()
static void
handle_sigusr1(int unused ATTRIBUTE_UNUSED)
{
got_sigusr1 = 1;
}
static void
set_signal_handling()
set_signal_handling(void)
/* We only use SIGALRM, SIGCHLD and SIGUSR1, and we unblock them only
* in wait_signal().
*/
......@@ -285,7 +284,7 @@ set_signal_handling()
}
static void
wait_signal()
wait_signal(void)
/* Return after a signal is caught */
{
sigset_t ss;
......@@ -298,7 +297,7 @@ wait_signal()
}
static void
wait_children()
wait_children(void)
/* Wait until we have no more children (of any kind) */
{
while (running_jobs > 0 || running_mailers > 0)
......@@ -312,14 +311,14 @@ wait_children()
}
static void
orderly_termination()
orderly_termination(void)
/* Execution is diverted here, when we get SIGUSR1 */
{
explain("Received SIGUSR1");
got_sigusr1 = 0;
wait_children();
explain("Exited");
exit(0);
exit(EXIT_SUCCESS);
}
static void
......@@ -342,7 +341,7 @@ xsleep(unsigned int n)
}
static void
wait_jobs()
wait_jobs(void)
/* Wait until there are no running jobs,
* servicing SIGCHLDs and SIGUSR1s in the meantime.
*/
......@@ -357,7 +356,7 @@ wait_jobs()
}
static void
record_start_time()
record_start_time(void)
{
struct tm *tm_now;
......@@ -373,17 +372,17 @@ record_start_time()
year, month, day_of_month);
}
static int
static unsigned int
time_till(job_rec *jr)
/* Return the number of seconds that we have to wait until it's time
* to start job jr.
*/
{
unsigned int tj, tn;
time_t tj, tn;
if (now) return 0;
tn = time(NULL);
tj = start_sec + jr->delay * 60;
tj = start_sec + (time_t)jr->delay * 60;
if (tj < tn) return 0;
if (tj - tn > 3600*24)
{
......@@ -391,11 +390,11 @@ time_till(job_rec *jr)
jr->ident);
return 0;
}
return tj - tn;
return (unsigned int)(tj - tn);
}
static void
fake_jobs()
fake_jobs(void)
{
int j;
......@@ -410,7 +409,7 @@ fake_jobs()
}
static void
explain_intentions()
explain_intentions(void)
{
int j;
......@@ -448,7 +447,7 @@ main(int argc, char *argv[])
if (gettimeofday(&tv, &tz) != 0)
explain("Can't get exact time, failure.");
srandom(getpid()+tv.tv_usec);
srandom((unsigned int)(getpid() + tv.tv_usec));
if((program_name = strrchr(argv[0], '/')) == NULL)
program_name = argv[0];
......@@ -471,12 +470,10 @@ main(int argc, char *argv[])
if (chdir(spooldir)) die_e("Can't chdir to %s", spooldir );
old_umask = umask(0);
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();
......@@ -490,15 +487,15 @@ main(int argc, char *argv[])
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();
......@@ -512,5 +509,5 @@ main(int argc, char *argv[])
}
wait_children();
explain("Normal exit (%d job%s run)", njobs, njobs == 1 ? "" : "s");
exit(0);
exit(EXIT_SUCCESS);
}