From aae1c9324a78d8477729d2c77d1460cf0025ffc0 Mon Sep 17 00:00:00 2001 From: Mark Johannes Date: Wed, 14 Aug 1996 17:20:03 +0000 Subject: pthread_cond_timedwait: added error cases for abstime --- cpukit/posix/src/cond.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'cpukit/posix/src/cond.c') diff --git a/cpukit/posix/src/cond.c b/cpukit/posix/src/cond.c index 25c175948f..4e87cf5c55 100644 --- a/cpukit/posix/src/cond.c +++ b/cpukit/posix/src/cond.c @@ -447,6 +447,17 @@ int pthread_cond_timedwait( const struct timespec *abstime ) { + if ( !abstime ) + return EINVAL; + +/* XXX need to fully address an error occuring in the total timespec */ + + if ( abstime->tv_sec < 0 || abstime->tv_nsec < 0 ) + return EINVAL; + + if ( abstime->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) + return EINVAL; + return _POSIX_Condition_variables_Wait_support( cond, mutex, -- cgit v1.2.3