]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
acl-permissions: Fix compilation error (regression 2025-09-10).
authorBruno Haible <bruno@clisp.org>
Wed, 5 Nov 2025 23:17:21 +0000 (00:17 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 5 Nov 2025 23:17:21 +0000 (00:17 +0100)
Reported by Eli Zaretskii <eliz@gnu.org> in
<https://lists.gnu.org/archive/html/emacs-devel/2025-11/msg00155.html>.

* lib/acl_entries.c (acl_entries): Restore a #if, mistakenly removed on
2025-09-10.

ChangeLog
lib/acl_entries.c

index e9eef97cd5301961bd7a1d9b7578a5a905c4006d..8c27811ea28ba5ca407b68a3172f66ebed9857b2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-11-05  Bruno Haible  <bruno@clisp.org>
+
+       acl-permissions: Fix compilation error (regression 2025-09-10).
+       Reported by Eli Zaretskii <eliz@gnu.org> in
+       <https://lists.gnu.org/archive/html/emacs-devel/2025-11/msg00155.html>.
+       * lib/acl_entries.c (acl_entries): Restore a #if, mistakenly removed on
+       2025-09-10.
+
 2025-11-04  Collin Funk  <collin.funk1@gmail.com>
 
        nproc: Fix compilation error with Android API ≤ 20.
index b78ba18a656cae206a0410d13cfe70b766b8083d..7b44e694896996944dd2aced01cf47aaba1378a4 100644 (file)
 #include "acl-internal.h"
 
 /* This file assumes POSIX-draft like ACLs
-   (Linux, FreeBSD, NetBSD >= 10, Mac OS X, Cygwin >= 2.5).  */
+   (Linux, FreeBSD, NetBSD >= 10, Mac OS X, Cygwin >= 2.5).
+
+   It is compiled only on systems that do not have the acl_entries() function
+   (in libc or libacl).  */
 
 /* Return the number of entries in ACL.
    Return -1 and set errno upon failure to determine it.  */
@@ -34,7 +37,8 @@ acl_entries (acl_t acl)
 
   if (acl != NULL)
     {
-#if HAVE_ACL_TYPE_EXTENDED /* Mac OS X */
+#if HAVE_ACL_FIRST_ENTRY /* Linux, FreeBSD, NetBSD >= 10, Mac OS X, Cygwin >= 2.5 */
+# if HAVE_ACL_TYPE_EXTENDED /* Mac OS X */
       /* acl_get_entry returns 0 when it successfully fetches an entry,
          and -1/EINVAL at the end.  */
       acl_entry_t ace;
@@ -44,7 +48,7 @@ acl_entries (acl_t acl)
            got_one >= 0;
            got_one = acl_get_entry (acl, ACL_NEXT_ENTRY, &ace))
         count++;
-#else /* Linux, FreeBSD, NetBSD >= 10, Cygwin >= 2.5 */
+# else /* Linux, FreeBSD, NetBSD >= 10, Cygwin >= 2.5 */
       /* acl_get_entry returns 1 when it successfully fetches an entry,
          and 0 at the end.  */
       acl_entry_t ace;
@@ -56,6 +60,7 @@ acl_entries (acl_t acl)
         count++;
       if (got_one < 0)
         return -1;
+# endif
 #endif
     }