Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Apply same treatment to cv_timedwaitbt.



details:   https://anonhg.NetBSD.org/src/rev/08745a1dffbd
branches:  trunk
changeset: 357481:08745a1dffbd
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Nov 12 20:04:51 2017 +0000

description:
Apply same treatment to cv_timedwaitbt.

diffstat:

 sys/kern/kern_condvar.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r c44ff1d51ca1 -r 08745a1dffbd sys/kern/kern_condvar.c
--- a/sys/kern/kern_condvar.c   Sun Nov 12 20:04:28 2017 +0000
+++ b/sys/kern/kern_condvar.c   Sun Nov 12 20:04:51 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_condvar.c,v 1.38 2017/11/12 19:46:34 riastradh Exp $      */
+/*     $NetBSD: kern_condvar.c,v 1.39 2017/11/12 20:04:51 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_condvar.c,v 1.38 2017/11/12 19:46:34 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_condvar.c,v 1.39 2017/11/12 20:04:51 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -448,12 +448,15 @@
  */
 int
 cv_timedwaitbt_sig(kcondvar_t *cv, kmutex_t *mtx, struct bintime *bt,
-    const struct bintime *epsilon __unused)
+    const struct bintime *epsilon __diagused)
 {
        struct bintime slept;
        unsigned start, end;
        int error;
 
+       KASSERTMSG(bt->sec >= 0, "negative timeout");
+       KASSERTMSG(epsilon != NULL, "specify maximum requested delay");
+
        /*
         * hardclock_ticks is technically int, but nothing special
         * happens instead of overflow, so we assume two's-complement



Home | Main Index | Thread Index | Old Index