Module Name: src
Committed By: martin
Date: Mon Sep 1 07:49:43 UTC 2014
Modified Files:
src/sys/dev: clock_subr.c
Log Message:
Reformulate an overflow test so it can be used in tool builds (i.e. does
not depend on netbsd specific macros).
To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/clock_subr.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/clock_subr.c
diff -u src/sys/dev/clock_subr.c:1.17 src/sys/dev/clock_subr.c:1.18
--- src/sys/dev/clock_subr.c:1.17 Sun Aug 31 08:54:40 2014
+++ src/sys/dev/clock_subr.c Mon Sep 1 07:49:43 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: clock_subr.c,v 1.17 2014/08/31 08:54:40 martin Exp $ */
+/* $NetBSD: clock_subr.c,v 1.18 2014/09/01 07:49:43 martin Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -46,7 +46,7 @@
#ifdef _KERNEL
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock_subr.c,v 1.17 2014/08/31 08:54:40 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock_subr.c,v 1.18 2014/09/01 07:49:43 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -121,7 +121,7 @@ clock_ymdhms_to_secs(struct clock_ymdhms
* 60 + dt->dt_min)
* 60 + dt->dt_sec;
- if ((time_t)secs < 0 || secs > __type_max(time_t))
+ if ((time_t)secs < 0 || (uint64_t)(time_t)secs != secs)
return -1;
return secs;
}