]> Savannah Git Hosting - gnulib.git/commitdiff
euidaccess: Fix test failure on native Windows.
authorBruno Haible <bruno@clisp.org>
Sat, 25 May 2024 13:48:32 +0000 (15:48 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 31 May 2024 21:53:23 +0000 (23:53 +0200)
* lib/euidaccess.c: Don't include <io.h>.
(euidaccess): On native Windows, invoke access, not _access.

ChangeLog
lib/euidaccess.c

index 36b3fb03ae987a4568e67084b5047c00c3bb51d7..893510feb43f036b999fe1345dff71bc76782ca6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-05-25  Bruno Haible  <bruno@clisp.org>
+
+       euidaccess: Fix test failure on native Windows.
+       * lib/euidaccess.c: Don't include <io.h>.
+       (euidaccess): On native Windows, invoke access, not _access.
+
 2024-05-25  Bruno Haible  <bruno@clisp.org>
 
        uchar-c23: Speed up mbrtoc32 on Solaris 11.4.
index c2ecbeff52a907524b9424f01347083acde166f4..6229f2c0d068178fc289486e7d0aae254befc8e8 100644 (file)
@@ -1,6 +1,6 @@
 /* euidaccess -- check if effective user id can access file
 
-   Copyright (C) 1990-1991, 1995, 1998, 2000, 2003-2006, 2008-2023 Free
+   Copyright (C) 1990-1991, 1995, 1998, 2000, 2003-2006, 2008-2024 Free
    Software Foundation, Inc.
 
    This file is part of the GNU C Library.
@@ -29,9 +29,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
-#if defined _WIN32 && ! defined __CYGWIN__
-# include <io.h>
-#else
+#if !(defined _WIN32 && ! defined __CYGWIN__)
 # include "root-uid.h"
 #endif
 
@@ -88,7 +86,7 @@ euidaccess (const char *file, int mode)
 #elif HAVE_EACCESS                      /* FreeBSD */
   return eaccess (file, mode);
 #elif defined _WIN32 && ! defined __CYGWIN__  /* mingw */
-  return _access (file, mode);
+  return access (file, mode);
 #else              /* Mac OS X, NetBSD, OpenBSD, HP-UX, Solaris, Cygwin, BeOS */
 
   uid_t uid = getuid ();