Gisle Vanem
2017-08-02 17:43:08 UTC
Compiling this new file (using MSVC-2015), give me these errors:
renameat2.c(55): error C2079: 'st' uses undefined struct 'stat'
renameat2.c(212): error C2065: 'file1': undeclared identifier
renameat2.c(212): warning C4047: 'function': 'const char *' differs in levels of indirection from 'int'
renameat2.c(212): warning C4024: 'at_func2': different types for formal and actual parameter 2
renameat2.c(212): error C2065: 'file2': undeclared identifier
renameat2.c(212): warning C4024: 'at_func2': different types for formal and actual parameter 4
I think this fixes it:
--- a/renameat2.c 2017-08-02 17:08:27
+++ b/renameat2.c 2017-08-02 17:40:56
@@ -47,6 +47,7 @@
#else
# include "openat-priv.h"
+# include <sys/stat.h>
static int
rename_noreplace (char const *src, char const *dst)
@@ -209,7 +210,7 @@
/* RENAME_NOREPLACE is the only flag currently supported. */
if (flags & ~RENAME_NOREPLACE)
return errno_fail (ENOTSUP);
- return at_func2 (fd1, file1, fd2, file2,
+ return at_func2 (fd1, src, fd2, dst,
flags ? rename_noreplace : rename);
renameat2.c(55): error C2079: 'st' uses undefined struct 'stat'
renameat2.c(212): error C2065: 'file1': undeclared identifier
renameat2.c(212): warning C4047: 'function': 'const char *' differs in levels of indirection from 'int'
renameat2.c(212): warning C4024: 'at_func2': different types for formal and actual parameter 2
renameat2.c(212): error C2065: 'file2': undeclared identifier
renameat2.c(212): warning C4024: 'at_func2': different types for formal and actual parameter 4
I think this fixes it:
--- a/renameat2.c 2017-08-02 17:08:27
+++ b/renameat2.c 2017-08-02 17:40:56
@@ -47,6 +47,7 @@
#else
# include "openat-priv.h"
+# include <sys/stat.h>
static int
rename_noreplace (char const *src, char const *dst)
@@ -209,7 +210,7 @@
/* RENAME_NOREPLACE is the only flag currently supported. */
if (flags & ~RENAME_NOREPLACE)
return errno_fail (ENOTSUP);
- return at_func2 (fd1, file1, fd2, file2,
+ return at_func2 (fd1, src, fd2, dst,
flags ? rename_noreplace : rename);
--
--gv
--gv