fix: debug flag 'test' cause endless loop

document debug flags

close PR bin/683
This commit is contained in:
Wolfram Schneider 1996-06-30 22:11:51 +00:00
parent 877329e059
commit 3eacc3d7fd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=16859
2 changed files with 15 additions and 6 deletions

View File

@ -15,14 +15,14 @@
.\" * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
.\" */
.\"
.\" $Id: cron.8,v 2.2 1993/12/28 08:34:43 vixie Exp $
.\" $Id: cron.8,v 1.1.1.1 1994/08/27 13:43:03 jkh Exp $
.\"
.TH CRON 8 "20 December 1993"
.UC 4
.SH NAME
cron \- daemon to execute scheduled commands (Vixie Cron)
.SH SYNOPSIS
cron
.B cron [-x debugflag[,...]]
.SH DESCRIPTION
.I Cron
should be started from /etc/rc or /etc/rc.local. It will return immediately,

View File

@ -16,7 +16,7 @@
*/
#if !defined(lint) && !defined(LINT)
static char rcsid[] = "$Id: cron.c,v 2.11 1994/01/15 20:43:43 vixie Exp $";
static char rcsid[] = "$Id: cron.c,v 1.1.1.1 1994/08/27 13:43:03 jkh Exp $";
#endif
@ -46,7 +46,16 @@ static void usage __P((void)),
static void
usage() {
char **dflags;
fprintf(stderr, "usage: %s [-x debugflag[,...]]\n", ProgramName);
fprintf(stderr, "\ndebugflags: ");
for(dflags = DebugFlagNames; *dflags; dflags++) {
fprintf(stderr, "%s ", *dflags);
}
fprintf(stderr, "\n");
exit(ERROR_EXIT);
}
@ -116,7 +125,7 @@ main(argc, argv)
cron_sync();
while (TRUE) {
# if DEBUGGING
if (!(DebugFlags & DTEST))
/* if (!(DebugFlags & DTEST)) */
# endif /*DEBUGGING*/
cron_sleep();
@ -290,12 +299,12 @@ parse_args(argc, argv)
while (EOF != (argch = getopt(argc, argv, "x:"))) {
switch (argch) {
default:
usage();
case 'x':
if (!set_debug_flags(optarg))
usage();
break;
default:
usage();
}
}
}