forked from I2P_Developers/i2p.i2p
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user