commit 7b27f01e07b6792d448a9680f413d1677c40ce55
parent 5c73bc5bc7b331b773d78761da505b20fd9db4c1
Author: ThomasV <thomasv@gitorious>
Date: Tue, 19 May 2015 11:56:33 +0200
call fsync before rename
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/lib/wallet.py b/lib/wallet.py
@@ -119,6 +119,8 @@ class WalletStorage(object):
s = json.dumps(self.data, indent=4, sort_keys=True)
with open(temp_path, "w") as f:
f.write(s)
+ f.flush()
+ os.fsync(f.fileno())
# perform atomic write on POSIX systems
try:
os.rename(temp_path, self.path)