6678444 pcfs presents wrong time stamps in leap years
authorbatschul
Thu, 03 Jul 2008 10:36:40 -0700
changeset 7023 7ed90015f6db
parent 7022 75d1d442d32d
child 7024 c74e1591c8fd
6678444 pcfs presents wrong time stamps in leap years
usr/src/uts/common/fs/pcfs/pc_subr.c
--- a/usr/src/uts/common/fs/pcfs/pc_subr.c	Thu Jul 03 10:18:45 2008 -0700
+++ b/usr/src/uts/common/fs/pcfs/pc_subr.c	Thu Jul 03 10:36:40 2008 -0700
@@ -19,7 +19,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -221,14 +221,14 @@
 	*unixtime = (int64_t)sec;
 	*unixtime += 60 * (int64_t)min;
 	*unixtime += 3600 * (int64_t)hour;
-	*unixtime += 86400 * (int64_t)day;
+	*unixtime += 86400 * (int64_t)(day -1);
 	while (month > 1) {
 		month--;
 		*unixtime += 86400 * (int64_t)days_in_month(month, year);
 	}
 	while (year > YEAR_ZERO) {
+		year--;
 		*unixtime += 86400 * (int64_t)days_in_year(year);
-		year--;
 	}
 	/*
 	 * For FAT, the beginning of all time is 01/01/1980,