diff --git a/sys/arch/vax/include/clock.h b/sys/arch/vax/include/clock.h index 30152d6a5dc7..dad4111a8e30 100644 --- a/sys/arch/vax/include/clock.h +++ b/sys/arch/vax/include/clock.h @@ -1,4 +1,4 @@ -/* $NetBSD: clock.h,v 1.7 2009/12/12 14:44:09 tsutsui Exp $ */ +/* $NetBSD: clock.h,v 1.8 2010/11/19 03:31:24 uwe Exp $ */ /* * Copyright (c) 1996 Ludd, University of Lule}, Sweden. * All rights reserved. @@ -37,7 +37,7 @@ /* * Time constants. These are unlikely to change. */ -#define IS_LEAPYEAR(y) (((y % 4) == 0) && (y % 100)) +#define IS_LEAPYEAR(y) ((((y % 4) == 0) && ((y % 100) != 0)) || ((y % 400) == 0)) #define SEC_PER_MIN (60) #define SEC_PER_HOUR (SEC_PER_MIN * 60) diff --git a/sys/arch/vax/vax/clock.c b/sys/arch/vax/vax/clock.c index 84ce4568bf43..83641ee4d74d 100644 --- a/sys/arch/vax/vax/clock.c +++ b/sys/arch/vax/vax/clock.c @@ -1,4 +1,4 @@ -/* $NetBSD: clock.c,v 1.53 2010/07/01 19:50:12 ragge Exp $ */ +/* $NetBSD: clock.c,v 1.54 2010/11/19 03:31:24 uwe Exp $ */ /* * Copyright (c) 1995 Ludd, University of Lule}, Sweden. * All rights reserved. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.53 2010/07/01 19:50:12 ragge Exp $"); +__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.54 2010/11/19 03:31:24 uwe Exp $"); #include #include @@ -199,18 +199,18 @@ yeartonum(int y) { int n; - for (n = 0, y -= 1; y > 69; y--) + for (n = 0, y -= 1; y > 1969; y--) n += SECPERYEAR(y); return n; } /* - * Converts tick number to a year 70 -> + * Converts tick number to a year 1970 -> */ int numtoyear(int num) { - int y = 70, j; + int y = 1970, j; while(num >= (j = SECPERYEAR(y))) { y++; num -= j;