--- a/jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java Sat Nov 06 09:11:18 2010 +0800
+++ b/jdk/src/share/classes/sun/nio/ch/FileChannelImpl.java Tue Nov 09 18:56:39 2010 +0000
@@ -460,6 +460,16 @@
} finally {
unmap(dbb);
}
+ } catch (ClosedByInterruptException e) {
+ // target closed by interrupt as ClosedByInterruptException needs
+ // to be thrown after closing this channel.
+ assert !target.isOpen();
+ try {
+ close();
+ } catch (IOException ignore) {
+ // nothing we can do
+ }
+ throw e;
} catch (IOException ioe) {
// Only throw exception if no bytes have been written
if (remaining == count)