diff options
author | Richard Henderson <rth@redhat.com> | 2014-04-02 13:27:29 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2014-04-02 13:27:29 -0700 |
commit | ab18f2f51cc15d464943663949d9872a15108b0a (patch) | |
tree | 47b819ab3c0e90f5bbb4ca4555eb28c8bbac83cb /libgomp | |
parent | a19b0bfd981e19b07423c47d9cd014ddf8f1ff0b (diff) | |
download | gcc-ab18f2f51cc15d464943663949d9872a15108b0a.zip gcc-ab18f2f51cc15d464943663949d9872a15108b0a.tar.gz gcc-ab18f2f51cc15d464943663949d9872a15108b0a.tar.bz2 |
libgomp: Fix default futex vs errno
* config/linux/futex.h (futex_wait): Get error value from errno.
(futex_wake): Likewise.
From-SVN: r209035
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 5 | ||||
-rw-r--r-- | libgomp/config/linux/futex.h | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index d3cda25..c0f093f 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2014-04-02 Richard Henderson <rth@redhat.com> + + * config/linux/futex.h (futex_wait): Get error value from errno. + (futex_wake): Likewise. + 2014-03-25 Jakub Jelinek <jakub@redhat.com> PR c++/60331 diff --git a/libgomp/config/linux/futex.h b/libgomp/config/linux/futex.h index 802abfd..63334c7 100644 --- a/libgomp/config/linux/futex.h +++ b/libgomp/config/linux/futex.h @@ -41,8 +41,8 @@ static inline void futex_wait (int *addr, int val) { - long err = syscall (SYS_futex, addr, gomp_futex_wait, val, NULL); - if (__builtin_expect (err == -ENOSYS, 0)) + int err = syscall (SYS_futex, addr, gomp_futex_wait, val, NULL); + if (__builtin_expect (err < 0 && errno == ENOSYS, 0)) { gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; @@ -53,8 +53,8 @@ futex_wait (int *addr, int val) static inline void futex_wake (int *addr, int count) { - long err = syscall (SYS_futex, addr, gomp_futex_wake, count); - if (__builtin_expect (err == -ENOSYS, 0)) + int err = syscall (SYS_futex, addr, gomp_futex_wake, count); + if (__builtin_expect (err < 0 && errno == ENOSYS, 0)) { gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; |