diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1996-03-04 15:59:49 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1996-03-04 15:59:49 +0000 |
commit | 5ebfbc1d3156d4ede9dcc95905ba0ac8dd9a492a (patch) | |
tree | f8c3c030695e0f3dab570932b42edabf91463b9d /usr.sbin/tcpdump/util.c | |
parent | c7c145692f0dc3ba8ff78b5282d0029587e26d68 (diff) |
Updating to the latest LBL release.
Sun's SKIP support added.
Diffstat (limited to 'usr.sbin/tcpdump/util.c')
-rw-r--r-- | usr.sbin/tcpdump/util.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/usr.sbin/tcpdump/util.c b/usr.sbin/tcpdump/util.c index 2c456a85e27..105b6e4029f 100644 --- a/usr.sbin/tcpdump/util.c +++ b/usr.sbin/tcpdump/util.c @@ -1,3 +1,4 @@ +/* $OpenBSD: util.c,v 1.2 1996/03/04 15:59:47 mickey Exp $ */ /* $NetBSD: util.c,v 1.3 1995/03/06 19:11:53 mycroft Exp $ */ /* @@ -319,16 +320,22 @@ read_infile(char *fname) int gmt2local() { -#ifndef SOLARIS - struct timeval now; +#ifndef SVR4 + struct timeval tv; struct timezone tz; - long t; + register struct tm *tm; + register int t; - if (gettimeofday(&now, &tz) < 0) + if (gettimeofday(&tv, &tz) < 0) error("gettimeofday"); + tm = localtime((time_t *)&tv.tv_sec); +#ifndef SUNOS3 + t = tm->tm_gmtoff; +#else t = tz.tz_minuteswest * -60; - if (localtime((time_t *)&now.tv_sec)->tm_isdst) - t += 3600; + if (tm->tm_isdst) + t += 60 * 60; +#endif return (t); #else tzset(); |