]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
copy: handle EOPNOTSUPP from SEEK_DATA
authorPádraig Brady <P@draigBrady.com>
Sun, 9 May 2021 20:55:22 +0000 (21:55 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 12 May 2021 21:14:11 +0000 (22:14 +0100)
* 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

index 69ba94b11c7cce0d59024753aa70a7a5ea435b7b..f626cfed72f039715f1575a8c4e5f8522b26f462 100644 (file)
@@ -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