]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
copy_file_range: deal with EXDEV
authorBaptiste Daroussin <bapt@FreeBSD.org>
Fri, 7 Apr 2023 12:47:30 +0000 (14:47 +0200)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Fri, 7 Apr 2023 12:47:30 +0000 (14:47 +0200)
in theory it is never supposed to happen, in practice it happened
on some version of the linux kernel.

src/dumpfd2fd.c

index 542f82d3b6b217a134b116d28f4d649b6a0b10e2..61015607a62c80e4df2f27a56d632a0e8d6c8792 100644 (file)
@@ -62,7 +62,7 @@ int dumpfd2fd(int from, int to)
 #ifdef HAVE_COPY_FILE_RANGE
                if (cfr) {
                        r = copy_file_range(from, NULL, to, NULL, SSIZE_MAX, 0);
-                       if (r < 0 && errno == EINVAL) {
+                       if (r < 0 && (errno == EINVAL || errno == EXDEV)) {
                                /* probably a non seekable FD */
                                cfr = false;
                        }