diff options
author | Jim Meyering <meyering@fb.com> | 2015-05-09 10:57:54 -0700 |
---|---|---|
committer | Jim Meyering <meyering@fb.com> | 2015-05-09 22:49:07 -0700 |
commit | aa7f31fc4a3f4d0c99086660d5ff008c559d657b (patch) | |
tree | 7aa9cd1d8bc4d1300e90039a8de93cc61c1fd064 /src/ls.c | |
parent | e981643ae3e57affdf3f4f6aa8bf53cf06433f17 (diff) | |
download | coreutils-aa7f31fc4a3f4d0c99086660d5ff008c559d657b.tar.xz |
build: avoid a warning form gcc's new -Wlogical-op
Without this change, very recent gcc (e.g., version 6.0.0 20150509)
would print the following when configured with --enable-gcc-warnings:
src/copy.c:165:30: error: logical 'or' of equal expressions \
[-Werror=logical-op]
&& (errno == EOPNOTSUPP || errno == ENOTSUP || errno == ENOSYS))
^
* src/system.h (is_ENOTSUP): New function.
* src/copy.c (punch_hole): Use it.
* src/ls.c (errno_unsupported, gobble_file): Use it.
Diffstat (limited to 'src/ls.c')
-rw-r--r-- | src/ls.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -2828,10 +2828,7 @@ clear_files (void) static bool errno_unsupported (int err) { - return (err == EINVAL - || err == ENOSYS - || err == ENOTSUP - || err == EOPNOTSUPP); + return (err == EINVAL || err == ENOSYS || is_ENOTSUP (err)); } /* Cache *getfilecon failure, when it's trivial to do so. @@ -3069,7 +3066,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 (errno == ENOTSUP || errno == EOPNOTSUPP || errno == ENODATA) + if (is_ENOTSUP (errno) || errno == ENODATA) err = 0; } |