Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev Make this compile- and usable from userland as well.



details:   https://anonhg.NetBSD.org/src/rev/fbe9afa42dfb
branches:  trunk
changeset: 331922:fbe9afa42dfb
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Aug 31 08:54:40 2014 +0000

description:
Make this compile- and usable from userland as well.

diffstat:

 sys/dev/clock_subr.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 09383a323b61 -r fbe9afa42dfb sys/dev/clock_subr.c
--- a/sys/dev/clock_subr.c      Sun Aug 31 07:23:53 2014 +0000
+++ b/sys/dev/clock_subr.c      Sun Aug 31 08:54:40 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clock_subr.c,v 1.16 2011/02/08 20:20:26 rmind Exp $    */
+/*     $NetBSD: clock_subr.c,v 1.17 2014/08/31 08:54:40 martin Exp $   */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -44,11 +44,16 @@
  * Derived from arch/hp300/hp300/clock.c
  */
 
+#ifdef _KERNEL
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock_subr.c,v 1.16 2011/02/08 20:20:26 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock_subr.c,v 1.17 2014/08/31 08:54:40 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
+#else
+#include <string.h>
+#include <time.h>
+#endif
 
 #include <dev/clock_subr.h>
 
@@ -116,7 +121,7 @@
            * 60 + dt->dt_min)
            * 60 + dt->dt_sec;
 
-       if ((time_t)secs != secs)
+       if ((time_t)secs < 0 || secs > __type_max(time_t))
                return -1;
        return secs;
 }



Home | Main Index | Thread Index | Old Index