]> Savannah Git Hosting - gnulib.git/commitdiff
renameat2: port to non-renameat platforms
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 2 Aug 2017 18:06:33 +0000 (11:06 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 2 Aug 2017 18:07:06 +0000 (11:07 -0700)
Problem reported for MSVC-2015 by Gisle Vanem in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-08/msg00001.html
* lib/renameat2.c [!HAVE_RENAMEAT]: Include <sys/stat.h> here too.
(renameat2) [!HAVE_RENAMEAT]: Fix typo in arg passing.

ChangeLog
lib/renameat2.c

index 44bdf79713fb7d43cebb6fc5ad645e5132d6e9a7..07d6d9976813d2cf270c39d9d1fb02860b40c1d0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2017-08-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       renameat2: port to non-renameat platforms
+       Problem reported for MSVC-2015 by Gisle Vanem in:
+       http://lists.gnu.org/archive/html/bug-gnulib/2017-08/msg00001.html
+       * lib/renameat2.c [!HAVE_RENAMEAT]: Include <sys/stat.h> here too.
+       (renameat2) [!HAVE_RENAMEAT]: Fix typo in arg passing.
+
 2017-08-01  Paul Eggert  <eggert@cs.ucla.edu>
 
        manywarnings: port to 32-bit GCC bug
index 60b721c4031a99982f5cfc42f0321742ac21abbd..9369dbfb0c9886ce46023c72836f2302f2fac443 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <errno.h>
 #include <stdio.h>
+#include <sys/stat.h>
 #include <unistd.h>
 
 #ifdef __linux__
@@ -40,7 +41,6 @@ errno_fail (int e)
 # include <stdbool.h>
 # include <stdlib.h>
 # include <string.h>
-# include <sys/stat.h>
 
 # include "dirname.h"
 # include "openat.h"
@@ -209,8 +209,7 @@ renameat2 (int fd1, char const *src, int fd2, char const *dst,
   /* RENAME_NOREPLACE is the only flag currently supported.  */
   if (flags & ~RENAME_NOREPLACE)
     return errno_fail (ENOTSUP);
-  return at_func2 (fd1, file1, fd2, file2,
-                   flags ? rename_noreplace : rename);
+  return at_func2 (fd1, src, fd2, dst, flags ? rename_noreplace : rename);
 
 #endif /* !HAVE_RENAMEAT */
 }