>From 4aad1aed6d19ca73527ab1819aae75f2b5813c8c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 2 Aug 2017 11:06:33 -0700 Subject: [PATCH] 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 here too. (renameat2) [!HAVE_RENAMEAT]: Fix typo in arg passing. --- ChangeLog | 8 ++++++++ lib/renameat2.c | 5 ++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 44bdf7971..07d6d9976 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2017-08-02 Paul Eggert + + 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 here too. + (renameat2) [!HAVE_RENAMEAT]: Fix typo in arg passing. + 2017-08-01 Paul Eggert manywarnings: port to 32-bit GCC bug diff --git a/lib/renameat2.c b/lib/renameat2.c index 60b721c40..9369dbfb0 100644 --- a/lib/renameat2.c +++ b/lib/renameat2.c @@ -22,6 +22,7 @@ #include #include +#include #include #ifdef __linux__ @@ -40,7 +41,6 @@ errno_fail (int e) # include # include # include -# include # 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 */ } -- 2.13.3