summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/xtensa
diff options
context:
space:
mode:
authorBaruch Siach <baruch@tkos.co.il>2013-10-02 16:14:55 +0300
committerChris Zankel <chris@zankel.net>2013-11-04 15:01:39 -0800
commita20d9fe5396585b6448aa13c5f6cf8d111b7b7f5 (patch)
tree2f32c0f47871ea7f6da3859508d27c755646392b /libc/sysdeps/linux/xtensa
parentcaee5620633acbf1b620d9704a5a372358adba32 (diff)
xtensa: fix atomic_decrement_if_positive() return value
atomic_decrement_if_positive() returns the old value of &mem, not the (sometimes undefined) value of __tmp. Fixes the uClibc nptl/tst-sem3 test. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Chris Zankel <chris@zankel.net>
Diffstat (limited to 'libc/sysdeps/linux/xtensa')
-rw-r--r--libc/sysdeps/linux/xtensa/bits/atomic.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/xtensa/bits/atomic.h b/libc/sysdeps/linux/xtensa/bits/atomic.h
index a31841a4b..b2be547f0 100644
--- a/libc/sysdeps/linux/xtensa/bits/atomic.h
+++ b/libc/sysdeps/linux/xtensa/bits/atomic.h
@@ -154,7 +154,7 @@ typedef uintmax_t uatomic_max_t;
: "=&a" (__value), "=&a" (__tmp) \
: "a" (mem) \
: "memory" ); \
- __tmp; \
+ __value; \
})