From 017877bd088284d515753d78b81ca6e6a88c1350 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Sun, 9 May 2021 21:55:22 +0100 Subject: [PATCH] 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. --- src/copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.47.2