diff options
Diffstat (limited to 'linuxthreads')
-rw-r--r-- | linuxthreads/ChangeLog | 5 | ||||
-rw-r--r-- | linuxthreads/semaphore.c | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog index 48e31cbf5a..d506b0a254 100644 --- a/linuxthreads/ChangeLog +++ b/linuxthreads/ChangeLog @@ -1,3 +1,8 @@ +2004-04-28 Jakub Jelinek <jakub@redhat.com> + + * semaphore.c (sem_timedwait): Return -1 and set errno instead of + returning error number [BZ #133]. Patch by <rmhaddad@yahoo.com>. + 2004-04-22 SUGIOKA Toshinobu <sugioka@itonet.co.jp> * sysdeps/unix/sysv/linux/sh/vfork.S: Fix wrong function pointer diff --git a/linuxthreads/semaphore.c b/linuxthreads/semaphore.c index e0dac41200..0793a5f712 100644 --- a/linuxthreads/semaphore.c +++ b/linuxthreads/semaphore.c @@ -225,7 +225,8 @@ int sem_timedwait(sem_t *sem, const struct timespec *abstime) /* The standard requires that if the function would block and the time value is illegal, the function returns with an error. */ __pthread_unlock(&sem->__sem_lock); - return EINVAL; + __set_errno (EINVAL); + return -1; } /* Set up extrication interface */ @@ -263,7 +264,8 @@ int sem_timedwait(sem_t *sem, const struct timespec *abstime) if (was_on_queue) { __pthread_set_own_extricate_if(self, 0); - return ETIMEDOUT; + __set_errno (ETIMEDOUT); + return -1; } /* Eat the outstanding restart() from the signaller */ |