diff options
author | Elliott Hughes <enh@google.com> | 2011-05-03 16:24:28 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2011-05-03 16:54:55 -0700 |
commit | d6ecf9222ec65a08e99f15fcc4ec024f0fffd13a (patch) | |
tree | 6f6c15ebb5f7cbfcdf9643801c19c2cc21e1c3db /dalvik | |
parent | 6ffd3944d05abf08b50cfcb2da68cc8198794570 (diff) | |
download | libcore-d6ecf9222ec65a08e99f15fcc4ec024f0fffd13a.zip libcore-d6ecf9222ec65a08e99f15fcc4ec024f0fffd13a.tar.gz libcore-d6ecf9222ec65a08e99f15fcc4ec024f0fffd13a.tar.bz2 |
Fix non-blocking connects.
The key change here is reintroducing the boolean return value, which we need
as long as the native code treats EINPROGRESS as a special case which doesn't
throw.
The rest is just drive-by incremental cleanup of the code.
Change-Id: I761b052adbb14e912c3853a35327f8a589cd4023
Diffstat (limited to 'dalvik')
-rw-r--r-- | dalvik/src/main/java/dalvik/system/BlockGuard.java | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/dalvik/src/main/java/dalvik/system/BlockGuard.java b/dalvik/src/main/java/dalvik/system/BlockGuard.java index 22d3d0b..13cc32d 100644 --- a/dalvik/src/main/java/dalvik/system/BlockGuard.java +++ b/dalvik/src/main/java/dalvik/system/BlockGuard.java @@ -208,9 +208,7 @@ public final class BlockGuard { public boolean isConnected(FileDescriptor fd, int timeout) throws IOException { if (timeout != 0) { - // Less than 0 is blocking forever. - // Greater than 0 is a timeout. - // Zero is okay. + // Greater than 0 is a timeout, but zero means "poll and return immediately". BlockGuard.getThreadPolicy().onNetwork(); } return mNetwork.isConnected(fd, timeout); |