From: Pádraig Brady
Date: Sun, 9 May 2021 20:55:22 +0000 (+0100) Subject: copy: handle EOPNOTSUPP from SEEK_DATA X-Git-Tag: v9.0~105 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=017877bd088284d515753d78b81ca6e6a88c1350;p=thirdparty%2Fcoreutils.git copy: handle EOPNOTSUPP from SEEK_DATA * src/copy.c (infer_scantype): Ensure we don't error out if SEEK_DATA returns EOPNOTSUPP, on systems where this value is distinct from ENOTSUP. Generally both of these should be checked. --- diff --git a/src/copy.c b/src/copy.c index 69ba94b11c..f626cfed72 100644 --- a/src/copy.c +++ b/src/copy.c @@ -1246,7 +1246,7 @@ infer_scantype (int fd, struct stat const *sb, scan_inference->ext_start = lseek (fd, 0, SEEK_DATA); if (0 <= scan_inference->ext_start) return LSEEK_SCANTYPE; - else if (errno != EINVAL && errno != ENOTSUP) + else if (errno != EINVAL && !is_ENOTSUP (errno)) return errno == ENXIO ? LSEEK_SCANTYPE : ERROR_SCANTYPE; #endif