From 7e9a64c1d1abda223774d523acd1dbf895f9421b Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Tue, 25 Oct 2011 17:09:27 -0700 Subject: Only tag/untag sockets when open. Bug: 5274621 Change-Id: Icc42a80c8cce6adb20d16ca2bb1fb51e2a8e8e1b --- dalvik/src/main/java/dalvik/system/SocketTagger.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'dalvik') 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$()); + } } /** -- cgit v1.1