mirror of
https://github.com/facebook/sapling.git
synced 2024-10-05 14:28:17 +03:00
eden: fix os.fdatasync crash on macos
Summary: Switch to `fsync` instead as heavier weight alternative Reviewed By: chadaustin Differential Revision: D17094899 fbshipit-source-id: 7b43eee18dbe793be53bd5d4d29885d2993fe235
This commit is contained in:
parent
45ac09554f
commit
b48f2a8a20
@ -436,7 +436,10 @@ class Overlay:
|
||||
)
|
||||
try:
|
||||
os.write(fd, contents)
|
||||
os.fdatasync(fd)
|
||||
if getattr(os, "fdatasync", None):
|
||||
os.fdatasync(fd)
|
||||
else:
|
||||
os.fsync(fd)
|
||||
os.fchmod(fd, 0o644)
|
||||
os.rename(tmp_path, file_path)
|
||||
except Exception:
|
||||
|
Loading…
Reference in New Issue
Block a user