i2psnark: Better handling of read-only i2psnark dir (ticket #1990)

Prevent add/create/remove/delete
More handling of RuntimeException via Snark.fatal() in SnarkManager
This commit is contained in:
zzz
2017-05-12 17:16:25 +00:00
parent 93cb2a0513
commit b340f4a17c
3 changed files with 66 additions and 23 deletions

View File

@@ -1243,8 +1243,13 @@ public class Snark
} catch (IOException ioe) {
if (storage != null) {
try { storage.close(); } catch (IOException ioee) {}
// clear storage, we have a mess if we have non-null storage and null metainfo,
// as on restart, Storage.reopen() will throw an ioe
storage = null;
}
fatal("Could not check or create storage", ioe);
// TODO we're still in an inconsistent state, won't work if restarted
// (PeerState "disconnecting seed that connects to seeds"
fatal("Could not create data files", ioe);
}
}