summaryrefslogtreecommitdiffstats
path: root/dalvik
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2011-10-25 17:09:27 -0700
committerJeff Sharkey <jsharkey@android.com>2011-10-25 17:52:52 -0700
commit7e9a64c1d1abda223774d523acd1dbf895f9421b (patch)
treefd083dec4d83756bb1d988c0195aaa8b90e1ba1b /dalvik
parentec8de076ac382cded43952ba0c2972282b09e1c7 (diff)
downloadlibcore-7e9a64c1d1abda223774d523acd1dbf895f9421b.zip
libcore-7e9a64c1d1abda223774d523acd1dbf895f9421b.tar.gz
libcore-7e9a64c1d1abda223774d523acd1dbf895f9421b.tar.bz2
Only tag/untag sockets when open.
Bug: 5274621 Change-Id: Icc42a80c8cce6adb20d16ca2bb1fb51e2a8e8e1b
Diffstat (limited to 'dalvik')
-rw-r--r--dalvik/src/main/java/dalvik/system/SocketTagger.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/dalvik/src/main/java/dalvik/system/SocketTagger.java b/dalvik/src/main/java/dalvik/system/SocketTagger.java
index 0228545..75242ce 100644
--- a/dalvik/src/main/java/dalvik/system/SocketTagger.java
+++ b/dalvik/src/main/java/dalvik/system/SocketTagger.java
@@ -50,11 +50,15 @@ public abstract class SocketTagger {
public abstract void untag(FileDescriptor socketDescriptor) throws SocketException;
public final void tag(Socket socket) throws SocketException {
- tag(socket.getFileDescriptor$());
+ if (!socket.isClosed()) {
+ tag(socket.getFileDescriptor$());
+ }
}
public final void untag(Socket socket) throws SocketException {
- untag(socket.getFileDescriptor$());
+ if (!socket.isClosed()) {
+ untag(socket.getFileDescriptor$());
+ }
}
/**