summaryrefslogtreecommitdiff
path: root/semaphore.c
diff options
context:
space:
mode:
Diffstat (limited to 'semaphore.c')
-rw-r--r--semaphore.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/semaphore.c b/semaphore.c
index f3bd5c9..5f7d083 100644
--- a/semaphore.c
+++ b/semaphore.c
@@ -267,6 +267,11 @@ _pthread_sem_timedwait (_pthread_sem_t * sem, const struct timespec * abstime)
const DWORD MILLISEC_PER_SEC = 1000;
DWORD milliseconds;
+ if (sem == NULL)
+ {
+ return EINVAL;
+ }
+
if (abstime == NULL)
{
milliseconds = INFINITE;
@@ -286,10 +291,7 @@ _pthread_sem_timedwait (_pthread_sem_t * sem, const struct timespec * abstime)
currSysTime.millitm;
}
- return ((sem == NULL)
- ? EINVAL
- : pthreadCancelableTimedWait (*sem, milliseconds)
- );
+ return (pthreadCancelableTimedWait (*sem, milliseconds));
} /* _pthread_sem_timedwait */