Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Reformulate an overflow test so it can be used in to...
details: https://anonhg.NetBSD.org/src/rev/02b68a9a7dcb
branches: trunk
changeset: 331936:02b68a9a7dcb
user: martin <martin%NetBSD.org@localhost>
date: Mon Sep 01 07:49:43 2014 +0000
description:
Reformulate an overflow test so it can be used in tool builds (i.e. does
not depend on netbsd specific macros).
diffstat:
sys/dev/clock_subr.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (27 lines):
diff -r 9f826e447833 -r 02b68a9a7dcb sys/dev/clock_subr.c
--- a/sys/dev/clock_subr.c Mon Sep 01 07:48:16 2014 +0000
+++ b/sys/dev/clock_subr.c Mon Sep 01 07:49:43 2014 +0000
@@ -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 @@
* 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;
}
Home |
Main Index |
Thread Index |
Old Index