fix: debug flag 'test' cause endless loop
document debug flags close PR bin/683
This commit is contained in:
parent
877329e059
commit
3eacc3d7fd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=16859
@ -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,
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user