fixup
This commit is contained in:
parent
0d4acde1bf
commit
17381f0281
@ -4,7 +4,6 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
import ctypes
|
import ctypes
|
||||||
import os
|
import os
|
||||||
from contextlib import contextmanager
|
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
import llnl.util.filesystem as fs
|
import llnl.util.filesystem as fs
|
||||||
@ -51,9 +50,7 @@ def atomic_update_renameat2(src, dest):
|
|||||||
if not dest_exists:
|
if not dest_exists:
|
||||||
fs.touch(dest)
|
fs.touch(dest)
|
||||||
try:
|
try:
|
||||||
rc = libc.renameat2(
|
rc = libc.renameat2(AT_FDCWD, src.encode(), AT_FDCWD, dest.encode(), RENAME_EXCHANGE)
|
||||||
AT_FDCWD, src.encode(), AT_FDCWD, dest.encode(), RENAME_EXCHANGE
|
|
||||||
)
|
|
||||||
if rc:
|
if rc:
|
||||||
raise OSError(f"renameat2 failed to exchange {src} and {dest}")
|
raise OSError(f"renameat2 failed to exchange {src} and {dest}")
|
||||||
if not dest_exists:
|
if not dest_exists:
|
||||||
|
Loading…
Reference in New Issue
Block a user