Skip to content
Commit 61855081 authored by Lucas A. M. Magalhaes's avatar Lucas A. M. Magalhaes Committed by Tulio Magno Quites Machado Filho
Browse files

nptl: Fix __futex_clocklock64 return error check [BZ #26964]



The earlier implementation of this, __lll_clocklock, calls lll_clockwait
that doesn't return the futex syscall error codes.  It always tries again
if that fails.

However in the current implementation, when the futex returns EAGAIN,
__futex_clocklock64 will also return EGAIN, even if the futex is taken.

This patch fixes the EAGAIN issue and also adds a check for EINTR.  As
futex syscall can return EINTR if the thread is interrupted by a signal.
In this case I'm assuming the function should continue trying to lock as
there is no mention to about it on POSIX.  Also add a test for both
scenarios.

Reviewed-by: default avatarAdhemerval Zanella <adhemerval.zanella@linaro.org>
parent 33fc3452
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment