summaryrefslogtreecommitdiff
path: root/src/copy.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2015-05-09 10:57:54 -0700
committerJim Meyering <meyering@fb.com>2015-05-09 22:49:07 -0700
commitaa7f31fc4a3f4d0c99086660d5ff008c559d657b (patch)
tree7aa9cd1d8bc4d1300e90039a8de93cc61c1fd064 /src/copy.c
parente981643ae3e57affdf3f4f6aa8bf53cf06433f17 (diff)
downloadcoreutils-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/copy.c')
-rw-r--r--src/copy.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/copy.c b/src/copy.c
index b93c53313..3af42957a 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -161,8 +161,7 @@ punch_hole (int fd, off_t offset, off_t length)
# if defined FALLOC_FL_PUNCH_HOLE && defined FALLOC_FL_KEEP_SIZE
ret = fallocate (fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
offset, length);
- if (ret < 0
- && (errno == EOPNOTSUPP || errno == ENOTSUP || errno == ENOSYS))
+ if (ret < 0 && (is_ENOTSUP (errno) || errno == ENOSYS))
ret = 0;
# endif
#endif