From 0e8f9af36f64397be8b5823cf69c1281bef12551 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Tue, 2 Apr 2024 13:21:41 +0100 Subject: [PATCH] renameatu: handle ENOSYS from renameatx_np * lib/renameatu.c(): Fall back to renameat() when renameatx_np(RENAME_EXCL) returns "Function not implemented". This issue was seen with macFUSE. Reported at https://github.com/coreutils/coreutils/issues/79 --- ChangeLog | 7 +++++++ lib/renameatu.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b30518785c..e214c08e27 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2024-04-02 Pádraig Brady + + renameatu: handle ENOSYS from renameatx_np + * lib/renameatu.c(): Fall back to renameat() without RENAME_EXCL + if "Function not implemented" is returned. This was seen with macFUSE. + Reported at https://github.com/coreutils/coreutils/issues/79 + 2024-03-29 Paul Eggert intprops: pacify GCC < 10 -Wsign-compare diff --git a/lib/renameatu.c b/lib/renameatu.c index 939e58965f..c9c84f27b8 100644 --- a/lib/renameatu.c +++ b/lib/renameatu.c @@ -1,5 +1,5 @@ /* Rename a file relative to open directories. - Copyright (C) 2009-2023 Free Software Foundation, Inc. + Copyright (C) 2009-2024 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -74,7 +74,7 @@ renameat2ish (int fd1, char const *src, int fd2, char const *dst, if (flags) { int r = renameatx_np (fd1, src, fd2, dst, RENAME_EXCL); - if (r == 0 || errno != ENOTSUP) + if (r == 0 || (errno != ENOTSUP && errno != ENOSYS)) return r; } # endif -- 2.39.5