summaryrefslogtreecommitdiffstats
path: root/usr.sbin/tcpdump/util.c
diff options
context:
space:
mode:
authormickey <mickey@openbsd.org>1996-03-04 15:58:52 +0000
committermickey <mickey@openbsd.org>1996-03-04 15:58:52 +0000
commit0cd0aa1a484cfafda4854fc93ed6a98937975928 (patch)
treed8f77919abf5ae7f1735049a2876d11ef796d703 /usr.sbin/tcpdump/util.c
parentUpdate to the latest LBL release. (diff)
downloadwireguard-openbsd-0cd0aa1a484cfafda4854fc93ed6a98937975928.tar.xz
wireguard-openbsd-0cd0aa1a484cfafda4854fc93ed6a98937975928.zip
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.c19
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();