diff options
author | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-08-21 20:55:24 +0000 |
---|---|---|
committer | Philip Guenthe <guenther@cvs.openbsd.org> | 2011-08-21 20:55:24 +0000 |
commit | 15ac8cb898dca98a1874a2d98a344e50e8898a8f (patch) | |
tree | f076491dcf9009245e7615eb0553e72c95c77549 /usr.bin/touch | |
parent | 6580c6a6541db7bb2146e82b1d5720341d6403d5 (diff) |
With gettimeofday() removed from the top of main(), need to call time()
for the defaulting of the year to work in the -t and arg1 forms that were
broken by previous change
ok millert@
Diffstat (limited to 'usr.bin/touch')
-rw-r--r-- | usr.bin/touch/touch.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/touch/touch.c b/usr.bin/touch/touch.c index 19a1d0a404f..d5c329dda5c 100644 --- a/usr.bin/touch/touch.c +++ b/usr.bin/touch/touch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: touch.c,v 1.18 2011/08/20 06:44:24 guenther Exp $ */ +/* $OpenBSD: touch.c,v 1.19 2011/08/21 20:55:23 guenther Exp $ */ /* $NetBSD: touch.c,v 1.11 1995/08/31 22:10:06 jtc Exp $ */ /* @@ -156,7 +156,7 @@ stime_arg1(char *arg, struct timespec *tsp) int yearset; char *dot, *p; /* Start with the current time. */ - tmptime = tsp[0].tv_sec; + tmptime = time(NULL); if ((lt = localtime(&tmptime)) == NULL) err(1, "localtime"); /* [[CC]YY]MMDDhhmm[.SS] */ @@ -227,7 +227,7 @@ stime_arg2(char *arg, int year, struct timespec *tsp) struct tm *lt; time_t tmptime; /* Start with the current time. */ - tmptime = tsp[0].tv_sec; + tmptime = time(NULL); if ((lt = localtime(&tmptime)) == NULL) err(1, "localtime"); |