about summary refs log tree commit diff
path: root/linuxthreads/semaphore.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2004-04-29 21:55:45 +0000
committerRoland McGrath <roland@gnu.org>2004-04-29 21:55:45 +0000
commit6f0b2e1f0fd3f2ce5a983c2e768619bb2739d8dd (patch)
tree89c8f1da730e421c3ceef3258f85d8144a3f1a1c /linuxthreads/semaphore.c
parent420a2f8b8dfe796e5f38da1e233ee99be6ec028f (diff)
downloadglibc-6f0b2e1f0fd3f2ce5a983c2e768619bb2739d8dd.tar.gz
glibc-6f0b2e1f0fd3f2ce5a983c2e768619bb2739d8dd.tar.xz
glibc-6f0b2e1f0fd3f2ce5a983c2e768619bb2739d8dd.zip
[BZ #130, BZ #131]
2004-04-28  Carlos O'Donell  <carlos@baldric.uwo.ca>
	* sysdeps/unix/sysv/linux/mq_getattr.c: Include <stddef.h>.
	* sysdeps/unix/sysv/linux/mq_notify.c: Likewise.
	* sysdeps/unix/sysv/linux/mq_open.c: Likewise.
	* sysdeps/unix/sysv/linux/mq_receive.c: Likewise.
	* sysdeps/unix/sysv/linux/mq_send.c: Likewise.

	* manual/resource.texi (sched_setaffinity, sched_getaffinity): Fix
	prototypes and description [BZ #131].

	* string/bits/string2.h (strpbrk): Cast NULL to char * [BZ #130].
	Patch by Ed Catmur <ed@catmur.co.uk>.
	* string/tst-inlcall.c (main): Add test for strpbrk.
Diffstat (limited to 'linuxthreads/semaphore.c')
-rw-r--r--linuxthreads/semaphore.c6
1 files changed, 4 insertions, 2 deletions
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 */