diff options
author | rpj <rpj> | 2002-02-01 07:24:03 +0000 |
---|---|---|
committer | rpj <rpj> | 2002-02-01 07:24:03 +0000 |
commit | 6a65a568fa4d9515265842c8bcf11a7449f3c325 (patch) | |
tree | 35cd38d44cd0d61c7ba3a6026eb3e696e9173453 | |
parent | f9c50f211c388410ccd8919f522cdd2c8d2d3904 (diff) |
* 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().
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | mutex.c | 4 | ||||
-rw-r--r-- | semaphore.c | 4 |
3 files changed, 14 insertions, 2 deletions
@@ -1,3 +1,11 @@ +2002-02-01 Ross Johnson <rpj@setup1.ise.canberra.edu.au>
+
+ * 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 <rpj@special.ise.canberra.edu.au>
* mutex.c (pthread_mutex_timedlock): New function suggested by
@@ -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 */ |