summaryrefslogtreecommitdiff
path: root/libpthread
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2005-02-28 01:52:50 +0000
committerManuel Novoa III <mjn3@codepoet.org>2005-02-28 01:52:50 +0000
commit702cfb3363c69e1a94ca711fa0e0339db1489b48 (patch)
tree441fa4db5e8ed032a62ec2713e055165fa55ac1f /libpthread
parent5533874b8f94639fca8d465586d744907d9b969e (diff)
Fix reported bug in error return behavior of sem_timedwait().
Diffstat (limited to 'libpthread')
-rw-r--r--libpthread/linuxthreads/semaphore.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libpthread/linuxthreads/semaphore.c b/libpthread/linuxthreads/semaphore.c
index 0038ddd2a..5be1f5316 100644
--- a/libpthread/linuxthreads/semaphore.c
+++ b/libpthread/linuxthreads/semaphore.c
@@ -226,7 +226,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 */
@@ -264,7 +265,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 */