MicroBlaze: negated errors in lowlevellock.h
authorKirk Meyer <kirk.meyer@sencore.com>
Fri, 14 Jun 2013 00:11:02 +0000 (10:11 +1000)
committerDavid Holsgrove <david.holsgrove@xilinx.com>
Fri, 14 Jun 2013 00:26:32 +0000 (10:26 +1000)
The macros in lowlevellock.h are returning positive errors, but the
users of the macros expect negative. This causes e.g. sem_wait to
sometimes return an error with errno set to -EWOULDBLOCK.

Signed-off-by: Kirk Meyer <kirk.meyer@sencore.com>
Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
ports/ChangeLog.microblaze
ports/sysdeps/unix/sysv/linux/microblaze/nptl/lowlevellock.h

index 79658fb..eb60f5b 100644 (file)
@@ -1,3 +1,8 @@
+2013-06-14  David Holsgrove <david.holsgrove@xilinx.com>
+
+       * sysdeps/unix/sysv/linux/microblaze/nptl/lowlevellock.h: Correct
+       return from macros.
+
 2013-06-05  Ondřej Bílka  <neleai@seznam.cz>
 
        * sysdeps/microblaze/bits/atomic.h: Remove executable mode.
index 45b8d9a..70f5537 100644 (file)
@@ -87,7 +87,7 @@
     __ret = INTERNAL_SYSCALL (futex, __err, 4, (long) (futexp),                \
                   __lll_private_flag (FUTEX_WAIT, private),                    \
                   (val), (timespec));                                          \
-    INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret;                  \
+    __ret;                                                                     \
   })
 
 #define lll_futex_timed_wait_bitset(futexp, val, timespec, clockbit, private)  \
@@ -99,7 +99,7 @@
                   __lll_private_flag (__op, private),                          \
                   (val), (timespec), NULL /* Unused.  */,                      \
                   FUTEX_BITSET_MATCH_ANY);                                     \
-    INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret;                  \
+    __ret;                                                                     \
   })
 
 #define lll_futex_wake(futexp, nr, private)                                    \
     __ret = INTERNAL_SYSCALL (futex, __err, 4, (long) (futexp),                \
                   __lll_private_flag (FUTEX_WAKE, private),                    \
                   (nr), 0);                                                    \
-    INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret;                  \
+    __ret;                                                                     \
   })
 
 #define lll_robust_dead(futexv, private)                                       \
     __ret = INTERNAL_SYSCALL (futex, __err, 5, (futexp),                       \
                   __lll_private_flag (__op, private),                          \
                   (val), (timespec), mutex);                                   \
-    INTERNAL_SYSCALL_ERROR_P (__ret, __err) ? -__ret : __ret;                  \
+    __ret;                                                                     \
   })
 
 #define lll_futex_cmp_requeue_pi(futexp, nr_wake, nr_move, mutex, val, priv)   \