From: Bruno Haible Date: Tue, 20 Mar 2018 07:37:44 +0000 (+0100) Subject: euidaccess: Port to native Windows. X-Git-Tag: v1.0~5696 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=66ae2f356a594c83ad690d0dfadbc9c9a4cec5f4;p=gnulib.git euidaccess: Port to native Windows. * lib/euidaccess.c (euidaccess): On native Windows, just use _access(). * posix-modules (exclude_for_mingw): Remove 'euidaccess'. --- diff --git a/ChangeLog b/ChangeLog index 3bbe99989e..9b8653f782 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2018-03-20 Bruno Haible + + 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 javacomp: Add support for Java 7, 8, 9. diff --git a/lib/euidaccess.c b/lib/euidaccess.c index aee693571c..4f512f5af5 100644 --- a/lib/euidaccess.c +++ b/lib/euidaccess.c @@ -29,8 +29,11 @@ #include #include #include - -#include "root-uid.h" +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ +# include +#else +# include "root-uid.h" +#endif #if HAVE_LIBGEN_H # include @@ -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 (); diff --git a/posix-modules b/posix-modules index 5d16d26a15..9315e757b4 100755 --- a/posix-modules +++ b/posix-modules @@ -227,7 +227,7 @@ exclude_for_mingw= # 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.