summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbatschul <none@none>2008-07-03 10:36:40 -0700
committerbatschul <none@none>2008-07-03 10:36:40 -0700
commit4d28e670862e4fde8bb48759a13931fbb4e145b3 (patch)
tree064c5f1158980fe24db25b9f9cf79f7e6fccae70
parent7127d9f61ee15a0e7f99192247bdfeefda826d58 (diff)
downloadillumos-joyent-4d28e670862e4fde8bb48759a13931fbb4e145b3.tar.gz
6678444 pcfs presents wrong time stamps in leap years
-rw-r--r--usr/src/uts/common/fs/pcfs/pc_subr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr/src/uts/common/fs/pcfs/pc_subr.c b/usr/src/uts/common/fs/pcfs/pc_subr.c
index 8202967743..a87b6657c8 100644
--- a/usr/src/uts/common/fs/pcfs/pc_subr.c
+++ b/usr/src/uts/common/fs/pcfs/pc_subr.c
@@ -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 @@ pc_pcttotv(
*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) {
- *unixtime += 86400 * (int64_t)days_in_year(year);
year--;
+ *unixtime += 86400 * (int64_t)days_in_year(year);
}
/*
* For FAT, the beginning of all time is 01/01/1980,