This message generated a parse failure. Raw output follows here. Please use 'back' to navigate. From devnull@lkml.org Thu May 2 23:33:24 2024 Received: from nic.funet.fi (nic.funet.fi [128.214.248.6]) by herbie.ucs.indiana.edu (8.7.5/8.6.12) with ESMTP id VAA24900 for ; Thu, 26 Sep 1996 21:14:41 -0500 (EST) Received: from vger.rutgers.edu ([128.6.190.2]) by nic.funet.fi with ESMTP id <74759-27711>; Fri, 27 Sep 1996 04:57:11 +0300 Received: by vger.rutgers.edu id <22175-18788>; Thu, 26 Sep 1996 21:36:02 -0400 Mime-Version: 1.0 Date: Thu, 26 Sep 1996 15:31:16 +0100 Message-Id: <24A95AB0.1424@mail.bl.uk> From: Mike.Bremford@mail.bl.uk (Mike Bremford) Subject: Re: Filesystems patch for Daylight Savings Time To: linux-kernel@vger.rutgers.edu, Gordon Chaffee Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Description: cc:Mail note part Sender: owner-linux-kernel@vger.rutgers.edu Precedence: bulk Sorry to ruin your day... I believe some Australian states have a DST of 1.5 hours or .5 hours - can't remember which (or possibly both) apply. Why not use the TZ things, or whatever it is that lives in /usr/lib/zoneinfo? Cheers... Mike (PS. Why not send Linus gold bars instead of cash? Just a thought...) ______________________________ Reply Separator _________________________________ Subject: Filesystems patch for Daylight Savings Time Author: Gordon Chaffee at Internet Date: 25/09/96 11:09 Some time ago, there was a report of a bug when writing the times to files on FAT filesystems when daylight savings time is in effect. The problem is that conversions from local time to GMT time and vice versa do not take into account daylight savings time. This problem seems to affect the hpfs, vfat, msdos, smbfs, and ncpfs filesystems. I believe it also affects affs, but I did not create a patch for it. I looked into daylight savings time, and all daylight savings times that I could find references to had offsets of one hour. If there are any cases where daylight savings time has an offset different than an hour, please let me know. Here is a patch again linux-2.0.0 to fix this problem. It should apply to just about any kernel since I don't believe the affected routines have been changed it quite awhile. Gordon Chaffee chaffee@plateau.cs.berkeley.edu --- linux/fs/hpfs/hpfs_fs.c.orig Tue Feb 20 00:28:13 1996 +++ linux/fs/hpfs/hpfs_fs.c Wed Sep 25 10:52:07 1996 @@ -321,7 +321,7 @@ static inline time_t local_to_gmt(time_t t) { extern struct timezone sys_tz; - return t + sys_tz.tz_minuteswest * 60; + return t + sys_tz.tz_minuteswest * 60 - (sys_tz.tz_dsttime ? 3600 : 0); } /* super block ops */ --- linux/fs/smbfs/proc.c.orig Thu Jun 6 15:56:30 1996 +++ linux/fs/smbfs/proc.c Wed Sep 25 10:52:46 1996 @@ -169,13 +169,15 @@ static int utc2local(int time) { - return time - sys_tz.tz_minuteswest*60; + return time - sys_tz.tz_minuteswest*60 + + (sys_tz.tz_dsttime ? 3600 : 0); } static int local2utc(int time) { - return time + sys_tz.tz_minuteswest*60; + return time + sys_tz.tz_minuteswest*60 - + (sys_tz.tz_dsttime ? 3600 : 0); } /* Convert a MS-DOS time/date pair to a UNIX date (seconds since 1 1 70). */ --- linux/fs/fat/misc.c.orig Fri May 17 11:44:39 1996 +++ linux/fs/fat/misc.c Wed Sep 25 10:53:27 1996 @@ -244,6 +244,9 @@ month < 2 ? 1 : 0)+3653); /* days since 1.1.70 plus 80's leap day */ secs += sys_tz.tz_minuteswest*60; + if (sys_tz.tz_dsttime) { + secs -= 3600; + } return secs; } --- linux/fs/ncpfs/dir.c.orig Tue Jun 4 16:12:18 1996 +++ linux/fs/ncpfs/dir.c Wed Sep 25 10:53:57 1996 @@ -1173,13 +1173,15 @@ static int utc2local(int time) { - return time - sys_tz.tz_minuteswest*60; + return time - sys_tz.tz_minuteswest*60 + + (sys_tz.tz_dsttime ? 3600 : 0); } static int local2utc(int time) { - return time + sys_tz.tz_minuteswest*60; + return time + sys_tz.tz_minuteswest*60 - + (sys_tz.tz_dsttime ? 3600 : 0); } /* Convert a MS-DOS time/date pair to a UNIX date (seconds since 1 1 70). */