Commit 88ea8271 authored by Elliott Hughes's avatar Elliott Hughes
Browse files

Avoid triggering StrictMode when closing a socket.

Originally, we called getsockoptLinger unconditionally, using ENOTSOCK
to recognize the non-socket case, but the cost of throwing an exception
is so high (both on dalvik and art) that we worked around that by doing
an fstat first. This was mostly fine, but fstat calls onReadFromDisk,
which isn't true for the socket case (which causes upset for threads
that are allowed to touch the network but not allowed to touch disk,
which Chrome uses, even though it's not immediately obvious to me why
that makes any sense).

(cherry-pick of d636777d.)

Bug: 4972558
Bug: 12133112
Change-Id: Ic0b89d1f181e436b4f43c1c04c1f706883ab84c0
parent a6bb8774
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment