]> Savannah Git Hosting - gnulib.git/commitdiff
euidaccess: Port to native Windows.
authorBruno Haible <bruno@clisp.org>
Tue, 20 Mar 2018 07:37:44 +0000 (08:37 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 20 Mar 2018 07:40:53 +0000 (08:40 +0100)
* lib/euidaccess.c (euidaccess): On native Windows, just use _access().
* posix-modules (exclude_for_mingw): Remove 'euidaccess'.

ChangeLog
lib/euidaccess.c
posix-modules

index 3bbe99989ebef37c6b1e743a3316a61a7596d424..9b8653f7825bb5b6bfd0991ca73beb937b27c713 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-03-20  Bruno Haible  <bruno@clisp.org>
+
+       euidaccess: Port to native Windows.
+       * lib/euidaccess.c (euidaccess): On native Windows, just use _access().
+       * posix-modules (exclude_for_mingw): Remove 'euidaccess'.
+
 2018-03-19  Bruno Haible  <bruno@clisp.org>
 
        javacomp: Add support for Java 7, 8, 9.
index aee693571c9d505796b85f482be95ddd23b244e8..4f512f5af5422b7c5401182e6176e7393c54e02e 100644 (file)
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
-
-#include "root-uid.h"
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# include <io.h>
+#else
+# include "root-uid.h"
+#endif
 
 #if HAVE_LIBGEN_H
 # include <libgen.h>
@@ -84,7 +87,9 @@ euidaccess (const char *file, int mode)
   return accessx (file, mode, ACC_SELF);
 #elif HAVE_EACCESS                      /* FreeBSD */
   return eaccess (file, mode);
-#else       /* Mac OS X, NetBSD, OpenBSD, HP-UX, Solaris, Cygwin, mingw, BeOS */
+#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__  /* mingw */
+  return _access (file, mode);
+#else              /* Mac OS X, NetBSD, OpenBSD, HP-UX, Solaris, Cygwin, BeOS */
 
   uid_t uid = getuid ();
   gid_t gid = getgid ();
index 5d16d26a151066bf253bcaed4936568c953c4fa1..9315e757b4b97f1ddffea4ec8510acef641412e1 100755 (executable)
@@ -227,7 +227,7 @@ exclude_for_mingw=
 # <grp.h> does not exist.
 exclude_for_mingw="$exclude_for_mingw pt_chown grantpt posix_openpt-tests posix_openpt"
 # The functions getuid, getgid, geteuid, getegid don't exist.
-exclude_for_mingw="$exclude_for_mingw euidaccess faccessat"
+exclude_for_mingw="$exclude_for_mingw faccessat"
 exclude_for_mingw="$exclude_for_mingw fchownat-tests fchownat"
 
 # Excludes for MSVC.