Codec2: Check errno during syscall (FUTEX_WAIT) failure in fence.wait

In C2SurfaceSyncObj, fence.wait() is handled as FUTEX_WAIT syscall.
In case of syscall failure (including timeout), returned value by
syscall() will always be -1, but with appropriate error code in errno.
So, check errno to return correct error code from waitForChange()
and which allows correct error code to be returned from fence.wait().

Without this, C2_BAD_VALUE is being returned even when fence.wait()
has timed-out. In case of timeout, C2_TIMED_OUT should be returned.

Author: Shrikara B

Bug: 215487388
Signed-off-by: Uma Mehta <quic_umamehta@quicinc.com>
Change-Id: I15761b35e3a03b0cefaa117db75fdfd21e53b339
1 file changed