bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

renameat2.c errors


From: Gisle Vanem
Subject: renameat2.c errors
Date: Wed, 2 Aug 2017 19:43:08 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

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);


--
--gv



reply via email to

[Prev in Thread] Current Thread [Next in Thread]