From: Paul Eggert Date: Thu, 7 Nov 2024 16:57:42 +0000 (-0800) Subject: ls: use Gnulib’s unsupported errno list X-Git-Tag: v9.6~108 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9d294afb987d692a133458c14ca4b2c8eed5d77;p=thirdparty%2Fcoreutils.git ls: use Gnulib’s unsupported errno list * bootstrap.conf (gnulib_modules): Add acl-permissions, which supplies acl_errno_valid, and which we are already using indirectly via file-has-acl. * src/ls.c (errno_unsupported): Remove. All calls replaced by !acl_errno_valid. --- diff --git a/bootstrap.conf b/bootstrap.conf index be9b8b7fdc..480e029310 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -28,6 +28,7 @@ avoided_gnulib_modules=' gnulib_modules=" $avoided_gnulib_modules acl + acl-permissions alignalloc alignasof alloca diff --git a/src/ls.c b/src/ls.c index 290ce35d24..962737432d 100644 --- a/src/ls.c +++ b/src/ls.c @@ -3277,14 +3277,6 @@ clear_files (void) file_size_width = 0; } -/* Return true if ERR implies lack-of-support failure by a - getxattr-calling function like file_has_acl. */ -static bool -errno_unsupported (int err) -{ - return (err == EINVAL || err == ENOSYS || is_ENOTSUP (err)); -} - /* Cache file_has_aclinfo failure, when it's trivial to do. Like file_has_aclinfo, but when F's st_dev says it's on a file system lacking ACL support, return 0 with ENOTSUP immediately. */ @@ -3303,7 +3295,7 @@ file_has_aclinfo_cache (char const *file, struct fileinfo *f, } int n = file_has_aclinfo (file, ai, flags); - if (n <= 0 && errno_unsupported (ai->u.err)) + if (n <= 0 && !acl_errno_valid (ai->u.err)) unsupported_device = f->stat.st_dev; return n; } @@ -3325,7 +3317,7 @@ has_capability_cache (char const *file, struct fileinfo *f) } bool b = has_capability (file); - if ( !b && errno_unsupported (errno)) + if ( !b && !acl_errno_valid (errno)) unsupported_device = f->stat.st_dev; return b; }