am dafa59b8: am 4dd0b72d: Merge "Return the actual success result from __futex."
* commit 'dafa59b8fff9ecd562487f9a186ac567c0908c5b': Return the actual success result from __futex.
This commit is contained in:
commit
8efc30544f
@ -42,12 +42,12 @@ struct timespec;
|
|||||||
static inline __always_inline int __futex(volatile void* ftx, int op, int value, const struct timespec* timeout) {
|
static inline __always_inline int __futex(volatile void* ftx, int op, int value, const struct timespec* timeout) {
|
||||||
// Our generated syscall assembler sets errno, but our callers (pthread functions) don't want to.
|
// Our generated syscall assembler sets errno, but our callers (pthread functions) don't want to.
|
||||||
int saved_errno = errno;
|
int saved_errno = errno;
|
||||||
if (__predict_false(syscall(__NR_futex, ftx, op, value, timeout) == -1)) {
|
int result = syscall(__NR_futex, ftx, op, value, timeout);
|
||||||
int result = -errno;
|
if (__predict_false(result == -1)) {
|
||||||
|
result = -errno;
|
||||||
errno = saved_errno;
|
errno = saved_errno;
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
return 0;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int __futex_wake(volatile void* ftx, int count) {
|
static inline int __futex_wake(volatile void* ftx, int count) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user