ls: fix spurious output with -Z

* src/ls.c (gobble_file): Only output an error if there actually
was an error.
This commit is contained in:
Pádraig Brady committed 2024-10-03 15:17:17 +01:00
1 parent 96100139fc
commit a94a551ee0
1 file changed
+1 -1
+1 -1
View File
@@ -3518,7 +3518,7 @@ gobble_file (char const *name, enum filetype type, ino_t inode,
ls fail just because the file (even a command line argument)
isn't on the right type of file system. I.e., a getfilecon
failure isn't in the same class as a stat failure. */
if (print_scontext
if (print_scontext && ai.scontext_err
&& (! (is_ENOTSUP (ai.scontext_err)
|| ai.scontext_err == ENODATA)))
error (0, ai.scontext_err, "%s", quotef (full_name));