diff options
author | peter <peter@FreeBSD.org> | 1997-03-11 11:59:39 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1997-03-11 11:59:39 +0000 |
commit | f59a1bdace6c4d430781dac9ecdb61b56a7ce466 (patch) | |
tree | 730714eb9f40740b836cf4b7eaa9cf50cc3cf4c9 /sbin/dump | |
parent | 0b3e1277b4e3cc3bb2575162ec238cac00b15a18 (diff) | |
parent | 5e2372f7211e467141b4939f21d1f81da257c059 (diff) | |
download | FreeBSD-src-f59a1bdace6c4d430781dac9ecdb61b56a7ce466.zip FreeBSD-src-f59a1bdace6c4d430781dac9ecdb61b56a7ce466.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r23669,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'sbin/dump')
-rw-r--r-- | sbin/dump/unctime.c | 57 |
1 files changed, 3 insertions, 54 deletions
diff --git a/sbin/dump/unctime.c b/sbin/dump/unctime.c index 7b3fd4e..bacb469 100644 --- a/sbin/dump/unctime.c +++ b/sbin/dump/unctime.c @@ -32,7 +32,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)unctime.c 8.1 (Berkeley) 6/5/93"; +static char sccsid[] = "@(#)unctime.c 8.2 (Berkeley) 6/14/94"; #endif /* not lint */ #include <sys/types.h> @@ -66,8 +66,6 @@ static char sccsid[] = "@(#)unctime.c 8.1 (Berkeley) 6/5/93"; #define E_SECOND 17 #define E_YEAR 20 -static int dcmp __P((struct tm *, struct tm *)); -static time_t emitl __P((struct tm *)); static int lookup __P((char *)); @@ -88,7 +86,8 @@ unctime(str) then.tm_min = atoi(&dbuf[E_MINUTE]); then.tm_sec = atoi(&dbuf[E_SECOND]); then.tm_year = atoi(&dbuf[E_YEAR]) - 1900; - return(emitl(&then)); + then.tm_isdst = -1; + return(mktime(&then)); } static char months[] = @@ -105,53 +104,3 @@ lookup(str) return((cp-months) / 3); return(-1); } -/* - * Routine to convert a localtime(3) format date back into - * a system format date. - * - * Use a binary search. - */ - -static time_t -emitl(dp) - struct tm *dp; -{ - time_t conv; - register int i, bit; - struct tm dcopy; - - dcopy = *dp; - dp = &dcopy; - conv = 0; - for (i = 30; i >= 0; i--) { - bit = 1 << i; - conv |= bit; - if (dcmp(localtime(&conv), dp) > 0) - conv &= ~bit; - } - return(conv); -} - -/* - * Compare two localtime dates, return result. - */ - -#define DECIDE(a) \ - if (dp->a > dp2->a) \ - return(1); \ - if (dp->a < dp2->a) \ - return(-1) - -static int -dcmp(dp, dp2) - register struct tm *dp, *dp2; -{ - - DECIDE(tm_year); - DECIDE(tm_mon); - DECIDE(tm_mday); - DECIDE(tm_hour); - DECIDE(tm_min); - DECIDE(tm_sec); - return(0); -} |