about summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-03-03 21:26:07 +0000
committerUlrich Drepper <drepper@redhat.com>2003-03-03 21:26:07 +0000
commitbe095ffaf426d462028b836432ef3ba32d45e3a5 (patch)
tree1bb4083f04a4b9e164991ad4d027e166b7198149 /nptl
parent868b9d6a268d5f79282079875d1ba719ef013303 (diff)
downloadglibc-be095ffaf426d462028b836432ef3ba32d45e3a5.tar.gz
glibc-be095ffaf426d462028b836432ef3ba32d45e3a5.tar.xz
glibc-be095ffaf426d462028b836432ef3ba32d45e3a5.zip
(pthread_rwlock_timedwrlock): Fix clobber of result variable by lll_futex_timed_wait call.
Diffstat (limited to 'nptl')
-rw-r--r--nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c b/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c
index 0715f835af..e4d08ea657 100644
--- a/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c
+++ b/nptl/sysdeps/pthread/pthread_rwlock_timedwrlock.c
@@ -37,6 +37,8 @@ pthread_rwlock_timedwrlock (rwlock, abstime)
 
   while (1)
     {
+      int err;
+
       /* Get the rwlock if there is no writer and no reader.  */
       if (rwlock->__data.__writer == 0 && rwlock->__data.__nr_readers == 0)
 	{
@@ -101,8 +103,8 @@ pthread_rwlock_timedwrlock (rwlock, abstime)
       lll_mutex_unlock (rwlock->__data.__lock);
 
       /* Wait for the writer or reader(s) to finish.  */
-      result = lll_futex_timed_wait (&rwlock->__data.__writer_wakeup,
-				     waitval, &rt);
+      err = lll_futex_timed_wait (&rwlock->__data.__writer_wakeup,
+				  waitval, &rt);
 
       /* Get the lock.  */
       lll_mutex_lock (rwlock->__data.__lock);
@@ -111,7 +113,7 @@ pthread_rwlock_timedwrlock (rwlock, abstime)
       --rwlock->__data.__nr_writers_queued;
 
       /* Did the futex call time out?  */
-      if (result == -ETIMEDOUT)
+      if (err == -ETIMEDOUT)
 	{
 	  result = ETIMEDOUT;
 	  break;