summaryrefslogtreecommitdiff
path: root/lib/libpthread/thread/thr_cond.c
diff options
context:
space:
mode:
authorDaniel Eischen <deischen@FreeBSD.org>1999-08-30 00:02:08 +0000
committerDaniel Eischen <deischen@FreeBSD.org>1999-08-30 00:02:08 +0000
commit3e12058d250979a442f182191a5ce1ac30e883ee (patch)
tree13739692ec180d8ab98c172f455828a41ce0702a /lib/libpthread/thread/thr_cond.c
parent293515f6787b4ef5ff8bce69ca6b5d5cd7f4cacd (diff)
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_cond.c')
-rw-r--r--lib/libpthread/thread/thr_cond.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/libpthread/thread/thr_cond.c b/lib/libpthread/thread/thr_cond.c
index 079a635f8de5..2eb05f982cc9 100644
--- a/lib/libpthread/thread/thr_cond.c
+++ b/lib/libpthread/thread/thr_cond.c
@@ -261,18 +261,20 @@ pthread_cond_timedwait(pthread_cond_t * cond, pthread_mutex_t * mutex,
int rval = 0;
int status;
- if (abstime->tv_sec < 0 ||
- abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000)
- return (EINVAL);
-
- if (cond == NULL)
+ if (cond == NULL || abstime == NULL)
rval = EINVAL;
+ if (abstime->tv_sec < 0 ||
+ abstime->tv_nsec < 0 || abstime->tv_nsec >= 1000000000) {
+ errno = EINVAL;
+ return (-1);
+ }
+
/*
* If the condition variable is statically initialized,
* perform the dynamic initialization:
*/
- else if (*cond != NULL ||
+ if (*cond != NULL ||
(rval = pthread_cond_init(cond,NULL)) == 0) {
/* Lock the condition variable structure: */
_SPINLOCK(&(*cond)->lock);