Author: toad
Date: 2008-02-12 17:18:55 +0000 (Tue, 12 Feb 2008)
New Revision: 17839
Modified:
trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
Log:
Squash post-close() java.io.IOException: Bad file descriptor
Modified: trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java
===================================================================
--- trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2008-02-12
16:53:06 UTC (rev 17838)
+++ trunk/freenet/src/freenet/store/BerkeleyDBFreenetStore.java 2008-02-12
17:18:55 UTC (rev 17839)
@@ -1323,6 +1323,11 @@
}
return block;
} catch(Throwable ex) { // FIXME: ugly
+ if(ex instanceof IOException) {
+ synchronized(this) {
+ if(closed) return null;
+ }
+ }
if(c!=null) {
try{c.close();}catch(DatabaseException ex2){}
}
@@ -1485,6 +1490,11 @@
}
} catch(Throwable ex) { // FIXME: ugly
+ if(ex instanceof IOException) {
+ synchronized(this) {
+ if(closed) return;
+ }
+ }
if(t!=null){
try{t.abort();}catch(DatabaseException ex2){}
}