]> Savannah Git Hosting - gnulib.git/commitdiff
file-has-acl: Fix test failure on Cygwin.
authorBruno Haible <bruno@clisp.org>
Mon, 7 Oct 2024 12:59:00 +0000 (14:59 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 7 Oct 2024 12:59:00 +0000 (14:59 +0200)
* lib/file-has-acl.c (file_has_aclinfo): On Cygwin, don't fail if
acl_get_file (name, ACL_TYPE_DEFAULT) returns NULL on a file of unknown
type.

ChangeLog
lib/file-has-acl.c

index d58f75c05f246df82d7bb8dedd50bcd386643df3..3cfb8d854e21422a1be8cd89b9a5242a2e26a586 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-10-07  Bruno Haible  <bruno@clisp.org>
+
+       file-has-acl: Fix test failure on Cygwin.
+       * lib/file-has-acl.c (file_has_aclinfo): On Cygwin, don't fail if
+       acl_get_file (name, ACL_TYPE_DEFAULT) returns NULL on a file of unknown
+       type.
+
 2024-10-07  Bruno Haible  <bruno@clisp.org>
 
        file-has-acl: Fix performance regression on FreeBSD, Cygwin.
index 0dfd25b52aa8d8ca3b1be9c5eb1b6815784048fe..64291e02d48c8b0f53806762b9866809285c17f2 100644 (file)
@@ -483,7 +483,14 @@ file_has_aclinfo (MAYBE_UNUSED char const *restrict name,
 #    endif
                 }
               else
-                ret = -1;
+                {
+#    ifdef __CYGWIN__ /* Cygwin >= 2.5 */
+                  if (d_type == DT_UNKNOWN)
+                    ret = 0;
+                  else
+#    endif
+                    ret = -1;
+                }
             }
 #   endif
         }