Commit b4af0b52 authored by Lorenzo Colitti's avatar Lorenzo Colitti
Browse files

Properly restore errno if NET_FAILURE_RETRY fails.

If NET_FAILURE_RETRY fails, it throws an exception. In all but
one codepath, that exception ends up being passed back to Java
land immediately, so it doesn't matter what errno is set to.

However, in the case where we need to retry the socket call with
a sockaddr_in (i.e., NET_IPV4_FALLBACK), we clear the exception
and march on. This means that if errno is touched by
throwErrnoException (strace showed this happening, for example,
if futex() returns EAGAIN), we don't retry the socket call and
instead return the previous EAFNOSUPPORT error to the caller.

Also modify IO_FAILURE_RETRY for consistency.

Bug: 23088314
Change-Id: Ib92771ba2001c2696f83f61f48bd137a7a91a880
parent 3dce8989
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment