Use os.fsync instead of os.fdatasync because macOS doesn't support fdatasync

Signed-off-by: David Kreitschmann <david@kreitschmann.de>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
David Kreitschmann
2017-04-07 18:09:19 +02:00
committed by Martin Basti
parent b8b28c3d09
commit f1c6a5d8de
2 changed files with 2 additions and 2 deletions

View File

@@ -579,7 +579,7 @@ class _TransportCertCache(object):
try:
f.write(pem)
f.flush()
os.fdatasync(f.fileno())
os.fsync(f.fileno())
f.close()
os.rename(f.name, filename)
except Exception:

View File

@@ -476,7 +476,7 @@ class Schema(object):
try:
self._write_schema_data(f)
f.flush()
os.fdatasync(f.fileno())
os.fsync(f.fileno())
f.close()
except Exception:
os.unlink(f.name)