jdk/src/share/classes/sun/nio/ch/SocketChannelImpl.java
changeset 12440 2689ca179e22
parent 9679 d98ae8bc45fc
child 12683 5c743840dd8a
--- a/jdk/src/share/classes/sun/nio/ch/SocketChannelImpl.java	Tue Apr 17 16:13:28 2012 +0400
+++ b/jdk/src/share/classes/sun/nio/ch/SocketChannelImpl.java	Tue Apr 17 07:14:14 2012 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -816,7 +816,8 @@
             // channel from using the old fd, which might be recycled in the
             // meantime and allocated to an entirely different channel.
             //
-            nd.preClose(fd);
+            if (state != ST_KILLED)
+                nd.preClose(fd);
 
             // Signal native threads, if needed.  If a target thread is not
             // currently blocked in an I/O operation then no harm is done since