summaryrefslogtreecommitdiff
path: root/sbin/dump/main.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-02-08 19:24:10 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-02-08 19:24:10 +0000
commit675d856532243ac50b1c14805a74c84028d4824c (patch)
tree9c91a5a86f82fb1117fa6eb6923c0678e32a8cc0 /sbin/dump/main.c
parent09a00a853f2ba06818d25b4cc017f754e28bfcc1 (diff)
y2k fixes; netbsd & Andreas.Gunnarsson@emw.ericsson.se
Diffstat (limited to 'sbin/dump/main.c')
-rw-r--r--sbin/dump/main.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sbin/dump/main.c b/sbin/dump/main.c
index 01c4c55da07..028d3bdbfbf 100644
--- a/sbin/dump/main.c
+++ b/sbin/dump/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.17 1997/07/05 05:35:56 millert Exp $ */
+/* $OpenBSD: main.c,v 1.18 1998/02/08 19:24:08 deraadt Exp $ */
/* $NetBSD: main.c,v 1.14 1997/06/05 11:13:24 lukem Exp $ */
/*-
@@ -110,11 +110,12 @@ main(argc, argv)
register struct fstab *dt;
register char *map;
register int ch;
+ struct tm then;
int i, anydirskipped, bflag = 0, Tflag = 0, honorlevel = 1;
ino_t maxino;
time_t tnow;
int dirlist;
- char *toplevel;
+ char *toplevel, *str;
spcl.c_date = 0;
(void)time((time_t *)&spcl.c_date);
@@ -181,7 +182,12 @@ main(argc, argv)
break;
case 'T': /* time of last dump */
- spcl.c_ddate = unctime(optarg);
+ str = strptime(optarg, "%a %b %e %H:%M:%S %Y", &then);
+ then.tm_isdst = -1;
+ if (str == NULL || (*str != '\n' && *str != '\0'))
+ spcl.c_ddate = (time_t) -1;
+ else
+ spcl.c_ddate = mktime(&then);
if (spcl.c_ddate < 0) {
(void)fprintf(stderr, "bad time \"%s\"\n",
optarg);