summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSheldon Hearn <sheldonh@FreeBSD.org>1999-06-18 08:52:13 +0000
committerSheldon Hearn <sheldonh@FreeBSD.org>1999-06-18 08:52:13 +0000
commit1427b87c55cb61521b404bef64ccbd608c9da934 (patch)
tree3d514676066fa848d397a4c270caad9c78cea1ca
parentccb0861e0153c07ed276d29a4e919581ff2b7ae9 (diff)
Notes
-rw-r--r--usr.bin/vacation/vacation.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/usr.bin/vacation/vacation.c b/usr.bin/vacation/vacation.c
index 6413341dc265..b94afe77ac80 100644
--- a/usr.bin/vacation/vacation.c
+++ b/usr.bin/vacation/vacation.c
@@ -42,7 +42,7 @@ static const char copyright[] =
static char sccsid[] = "@(#)from: vacation.c 8.2 (Berkeley) 1/26/94";
#endif
static const char rcsid[] =
- "$Id: vacation.c,v 1.15 1999/06/17 14:48:02 sheldonh Exp $";
+ "$Id: vacation.c,v 1.16 1999/06/17 14:49:19 sheldonh Exp $";
#endif /* not lint */
/*
@@ -114,9 +114,9 @@ main(argc, argv)
struct passwd *pw;
ALIAS *cur;
time_t interval;
- int ch, iflag, lflag, mfail;
+ int ch, iflag, lflag, mfail, ufail;
- opterr = iflag = lflag = mfail = 0;
+ opterr = iflag = lflag = mfail = ufail = 0;
interval = -1;
while ((ch = getopt(argc, argv, "a:dIilr:")) != -1) {
switch((char)ch) {
@@ -143,24 +143,27 @@ main(argc, argv)
if (isdigit(*optarg)) {
interval = atol(optarg) * 86400;
if (interval < 0)
- usage();
+ ufail++;
}
else
interval = LONG_MAX;
break;
case '?':
default:
- usage();
+ ufail++;
}
}
- /* Only die on the above malloc failure here so that the
+ /*
+ * Only die on the above malloc and usage errors here so that the
* correct logging medium is used.
*/
if (mfail) {
msglog(LOG_ERR, "vacation: malloc failed\n");
exit(EX_TEMPFAIL);
}
+ else if (ufail)
+ usage();
argc -= optind;
argv += optind;