From d7792429486c1208360f450c2ebbcf61c0a25136 Mon Sep 17 00:00:00 2001 From: mycroft Date: Sat, 11 May 1996 13:18:00 +0000 Subject: [PATCH] Use the correct time zone info; not what the kernel says. (Forward to tcpdump maintainers.) --- usr.sbin/tcpdump/util.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/usr.sbin/tcpdump/util.c b/usr.sbin/tcpdump/util.c index 2c456a85e27b..cd1b8bb5578a 100644 --- a/usr.sbin/tcpdump/util.c +++ b/usr.sbin/tcpdump/util.c @@ -1,4 +1,4 @@ -/* $NetBSD: util.c,v 1.3 1995/03/06 19:11:53 mycroft Exp $ */ +/* $NetBSD: util.c,v 1.4 1996/05/11 13:18:00 mycroft Exp $ */ /* * Copyright (c) 1990, 1991, 1993, 1994 @@ -320,16 +320,11 @@ int gmt2local() { #ifndef SOLARIS - struct timeval now; - struct timezone tz; - long t; + time_t now; - if (gettimeofday(&now, &tz) < 0) - error("gettimeofday"); - t = tz.tz_minuteswest * -60; - if (localtime((time_t *)&now.tv_sec)->tm_isdst) - t += 3600; - return (t); + if (time(&now) == -1) + error("time"); + return (localtime(&now)->tm_gmtoff); #else tzset(); return (-altzone);