patch-2.0.34 linux/fs/isofs/util.c

Next file: linux/fs/locks.c
Previous file: linux/fs/isofs/rock.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.33/linux/fs/isofs/util.c linux/fs/isofs/util.c
@@ -9,6 +9,8 @@
  *  the 386bsd iso9660 filesystem, by Pace Willisson <pace@blitz.com>.
  */
 
+#include <linux/time.h>
+
 int
 isonum_711 (char * p)
 {
@@ -84,10 +86,9 @@
 	return (isonum_731 (p));
 }
 
-/* We have to convert from a MM/DD/YY format to the unix ctime format.  We have to
-   take into account leap years and all of that good stuff.  Unfortunately, the kernel
-   does not have the information on hand to take into account daylight savings time,
-   so there will be cases (roughly half the time) where the dates are off by one hour. */
+/* We have to convert from a MM/DD/YY format to the unix ctime format.
+ * We have to take into account leap years and all of that good stuff.
+ */
 int iso_date(char * p, int flag)
 {
 	int year, month, day, hour ,minute, second, tz;
@@ -106,6 +107,8 @@
 		crtime = 0;
 	} else {
 		int monlen[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
+		extern struct timezone sys_tz;
+
 		days = year * 365;
 		if (year > 2)
 			days += (year+1) / 4;
@@ -116,7 +119,9 @@
 		days += day - 1;
 		crtime = ((((days * 24) + hour) * 60 + minute) * 60)
 			+ second;
-		
+		if (sys_tz.tz_dsttime)
+			crtime -= 3600;
+
 		/* sign extend */
 		if (tz & 0x80)
 			tz |= (-1 << 8);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov