mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 06:26:15 +01:00
Merge branch 'pkj/fix-g_futex_simple' into 'main'
Avoid having g_futex_simple() inadvertently modify errno See merge request GNOME/glib!3398
This commit is contained in:
commit
1df0e81b19
@ -65,9 +65,13 @@ struct _GRealThread
|
||||
#define g_futex_simple(uaddr, futex_op, ...) \
|
||||
G_STMT_START \
|
||||
{ \
|
||||
int saved_errno = errno; \
|
||||
int res = syscall (__NR_futex_time64, uaddr, (gsize) futex_op, __VA_ARGS__); \
|
||||
if (res < 0 && errno == ENOSYS) \
|
||||
syscall (__NR_futex, uaddr, (gsize) futex_op, __VA_ARGS__); \
|
||||
{ \
|
||||
errno = saved_errno; \
|
||||
syscall (__NR_futex, uaddr, (gsize) futex_op, __VA_ARGS__); \
|
||||
} \
|
||||
} \
|
||||
G_STMT_END
|
||||
#elif defined(__NR_futex_time64)
|
||||
|
Loading…
Reference in New Issue
Block a user