Console: Fix stopping of webapps when console stops (ticket #1893)

i2psnark: Only rewrite torrent config file if changed (ticket #1893)
Util: Don't sync config writes on Android/ARM (ticket #1893)
This commit is contained in:
zzz
2017-04-01 14:15:06 +00:00
parent 5eefb8b222
commit f390831835
6 changed files with 68 additions and 10 deletions

View File

@@ -46,6 +46,7 @@ import net.i2p.util.OrderedProperties;
import net.i2p.util.ReusableGZIPInputStream;
import net.i2p.util.ReusableGZIPOutputStream;
import net.i2p.util.SecureFileOutputStream;
import net.i2p.util.SystemVersion;
import net.i2p.util.Translate;
/**
@@ -55,6 +56,9 @@ import net.i2p.util.Translate;
*/
public class DataHelper {
/** See storeProps(). 600-750 ms on RPi. */
private static final boolean SHOULD_SYNC = !(SystemVersion.isAndroid() || SystemVersion.isARM());
/**
* Map of String to itself to cache common
* keys in RouterInfo, RouterAddress, and BlockfileNamingService properties.
@@ -514,8 +518,10 @@ public class DataHelper {
}
out.println(name + "=" + val);
}
out.flush();
fos.getFD().sync();
if (SHOULD_SYNC) {
out.flush();
fos.getFD().sync();
}
out.close();
if (out.checkError()) {
out = null;