From d9637751cbb908f53968aa72ef0d1dc1a46e5451 Mon Sep 17 00:00:00 2001 From: Gregory Becker Date: Tue, 21 Mar 2023 12:40:48 -0700 Subject: [PATCH] flake --- lib/spack/spack/util/atomic_update.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/spack/spack/util/atomic_update.py b/lib/spack/spack/util/atomic_update.py index 5a6c1890525..bc1bcd0d7ad 100644 --- a/lib/spack/spack/util/atomic_update.py +++ b/lib/spack/spack/util/atomic_update.py @@ -33,7 +33,7 @@ def atomic_update(oldpath, newpath): on other systems, oldpath is not affected but all paths are abstracted by a symlink to allow for atomic updates. """ - if has_renameat2(): + if renameat2: return atomic_update_renameat2(oldpath, newpath) else: return atomic_update_symlink(oldpath, newpath) @@ -48,7 +48,7 @@ def atomic_update_renameat2(src, dest): if not dest_exists: fs.touch(dest) try: - rc = libc.renameat2(AT_FDCWD, src.encode(), AT_FDCWD, dest.encode(), RENAME_EXCHANGE) + rc = renameat2(AT_FDCWD, src.encode(), AT_FDCWD, dest.encode(), RENAME_EXCHANGE) if rc: raise OSError(f"renameat2 failed to exchange {src} and {dest}") if not dest_exists: