summaryrefslogtreecommitdiff
path: root/src/ls.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-05-05 13:12:28 +0000
committerJim Meyering <jim@meyering.net>1999-05-05 13:12:28 +0000
commit19d33cea2b8d11ce87aaa7c761c3eee2b64a714b (patch)
treeb70882bab8dcf354da36f126dd16d9f9bfc86c95 /src/ls.c
parentc4ddb7f83ad92f1bfc02779cacd340b5ff8d60a5 (diff)
downloadcoreutils-19d33cea2b8d11ce87aaa7c761c3eee2b64a714b.tar.xz
(USE_ACL): Define this only #if
(HAVE_SYS_ACL_H && HAVE_ACL && defined GETACLCNT). Use `USE_ACL' in place of `HAVE_ACL' everywhere else. From Kaveh Ghazi.
Diffstat (limited to 'src/ls.c')
-rw-r--r--src/ls.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/ls.c b/src/ls.c
index a657ebf51..6b98db6a1 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -84,6 +84,13 @@
#include "strverscmp.h"
#include "xstrtol.h"
+/* Use access control lists only under all the following conditions.
+ Some systems (OSF4, Irix5, Irix6) have the acl function, but not
+ sys/acl.h or don't define the GETACLCNT macro. */
+#if HAVE_SYS_ACL_H && HAVE_ACL && defined GETACLCNT
+# define USE_ACL 1
+#endif
+
#define PROGRAM_NAME (ls_mode == LS_LS ? "ls" \
: (ls_mode == LS_MULTI_COL \
? "dir" : "vdir"))
@@ -164,14 +171,14 @@ struct fileinfo
enum filetype filetype;
-#if HAVE_ACL
+#if USE_ACL
/* For long listings, nonzero if the file has an access control list,
otherwise zero. */
int have_acl;
#endif
};
-#if HAVE_ACL
+#if USE_ACL
# define FILE_HAS_ACL(F) ((F)->have_acl)
#else
# define FILE_HAS_ACL(F) 0
@@ -1745,7 +1752,7 @@ gobble_file (const char *name, int explicit_arg, const char *dirname)
else
{
val = lstat (path, &files[files_index].stat);
-#if HAVE_ACL
+#if USE_ACL
files[files_index].have_acl = (acl (path, GETACLCNT, 0, NULL) > 4);
#endif
}