Module Name: src
Committed By: riastradh
Date: Sun Nov 12 20:04:51 UTC 2017
Modified Files:
src/sys/kern: kern_condvar.c
Log Message:
Apply same treatment to cv_timedwaitbt.
To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/kern/kern_condvar.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/kern/kern_condvar.c
diff -u src/sys/kern/kern_condvar.c:1.38 src/sys/kern/kern_condvar.c:1.39
--- src/sys/kern/kern_condvar.c:1.38 Sun Nov 12 19:46:34 2017
+++ src/sys/kern/kern_condvar.c Sun Nov 12 20:04:51 2017
@@ -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 @@ cv_timedwaitbt(kcondvar_t *cv, kmutex_t
*/
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