From 6a65a568fa4d9515265842c8bcf11a7449f3c325 Mon Sep 17 00:00:00 2001 From: rpj Date: Fri, 1 Feb 2002 07:24:03 +0000 Subject: * semaphore.c (sem_trywait): Fix missing errno return for systems that define NEED_SEM (e.g. early WinCE). * mutex.c (pthread_mutex_timedlock): Return ENOTSUP for systems that define NEED_SEM since they don't have sem_trywait(). --- ChangeLog | 8 ++++++++ mutex.c | 4 ++++ semaphore.c | 4 ++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f29b217..5b7fb08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-02-01 Ross Johnson + + * semaphore.c (sem_trywait): Fix missing errno return + for systems that define NEED_SEM (e.g. early WinCE). + * mutex.c (pthread_mutex_timedlock): Return ENOTSUP + for systems that define NEED_SEM since they don't + have sem_trywait(). + 2002-01-27 Ross Johnson * mutex.c (pthread_mutex_timedlock): New function suggested by diff --git a/mutex.c b/mutex.c index 72847d5..85fdab4 100644 --- a/mutex.c +++ b/mutex.c @@ -835,6 +835,10 @@ pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *abstime) int result = 0; pthread_mutex_t mx; +#ifdef NEED_SEM + errno = ENOTSUP; + return -1; +#endif if (mutex == NULL || *mutex == NULL) { diff --git a/semaphore.c b/semaphore.c index 54005db..86222ec 100644 --- a/semaphore.c +++ b/semaphore.c @@ -258,7 +258,7 @@ sem_trywait (sem_t * sem) * ERRNO * EAGAIN the semaphore was already locked, * EINVAL 'sem' is not a valid semaphore, - * ENOSYS semaphores are not supported, + * ENOTSUP sem_trywait is not supported, * EINTR the function was interrupted by a signal, * EDEADLK a deadlock condition was detected. * @@ -270,7 +270,7 @@ sem_trywait (sem_t * sem) /* * not yet implemented! */ - int result = EINVAL; + errno = ENOTSUP; return -1; #else /* NEED_SEM */ -- cgit v1.2.3