]> Savannah Git Hosting - gnulib.git/commitdiff
renameatu: handle ENOSYS from renameatx_np
authorPádraig Brady <P@draigBrady.com>
Tue, 2 Apr 2024 12:21:41 +0000 (13:21 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 8 Apr 2024 11:12:10 +0000 (13:12 +0200)
* 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
lib/renameatu.c

index b30518785c430176fbf89aa31d64a0159aa5b19a..e214c08e27332ef1163c3e2d98014d6e6941884f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-04-02  Pádraig Brady  <P@draigBrady.com>
+
+       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  <eggert@cs.ucla.edu>
 
        intprops: pacify GCC < 10 -Wsign-compare
index 939e58965f5615a4bba83918175c88aef525b7c8..c9c84f27b8d212b7f93ea111e925c9a6becc1e35 100644 (file)
@@ -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