Paul Eggert wrote:
> (acl_get_fdfile): New function, if needed.
This patch leads to a compilation error on Solaris. Found by the CI
on Solaris 11.4:
../../gllib/file-has-acl.c: In function ‘acl_get_fdfile’:
../../gllib/file-has-acl.c:413:45: error: ‘acl_get_file’ undeclared (first use
in this function); did you mean ‘acl_get_fdfile’?
413 | acl_t (*get) (char const *, acl_type_t) = acl_get_file;
| ^~~~~~~~~~~~
| acl_get_fdfile
../../gllib/file-has-acl.c:413:45: note: each undeclared identifier is reported
only once for each function it appears in
At top level:
../../gllib/file-has-acl.c:411:1: warning: ‘acl_get_fdfile’ defined but not
used [-Wunused-function]
411 | acl_get_fdfile (int fd, char const *name, acl_type_t type, int flags)
| ^~~~~~~~~~~~~~
*** Error code 1
make: Fatal error: Command failed for target `file-has-acl.o'
and likewise on Solaris 11 OmniOS.
This patch fixes it.
2025-05-12 Bruno Haible <[email protected]>
file-has-acl: Fix compilation error on Solaris (regression 2025-05-09).
* lib/file-has-acl.c (acl_get_fdfile): Don't define on platforms that
don't need it.
diff --git a/lib/file-has-acl.c b/lib/file-has-acl.c
index a356ee0d0b..a9cfbf3a16 100644
--- a/lib/file-has-acl.c
+++ b/lib/file-has-acl.c
@@ -382,10 +382,11 @@ acl_nfs4_nontrivial (uint32_t *xattr, ssize_t nbytes)
}
#endif
-#if (!USE_LINUX_XATTR && USE_ACL && !HAVE_ACL_EXTENDED_FILE \
- && !HAVE_ACL_TYPE_EXTENDED)
+#if (!USE_LINUX_XATTR && USE_ACL && HAVE_ACL_GET_FILE \
+ && !HAVE_ACL_EXTENDED_FILE && !HAVE_ACL_TYPE_EXTENDED)
+/* FreeBSD, NetBSD >= 10, IRIX, Tru64, Cygwin >= 2.5 */
-# if HAVE_ACL_GET_FD && !HAVE_ACL_GET_LINK_NP
+# if HAVE_ACL_GET_FD && !HAVE_ACL_GET_LINK_NP /* IRIX, Tru64, Cygwin >= 2.5 */
# include <fcntl.h>
# ifdef O_PATH
# define acl_get_fd_np(fd, type) acl_get_fd (fd)