From: Baptiste Daroussin Date: Fri, 7 Apr 2023 12:47:30 +0000 (+0200) Subject: copy_file_range: deal with EXDEV X-Git-Tag: RELEASE_1_4_0b1~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d599170a067b30741c98ebb8c8d2988d195b028;p=thirdparty%2Fmlmmj.git copy_file_range: deal with EXDEV in theory it is never supposed to happen, in practice it happened on some version of the linux kernel. --- diff --git a/src/dumpfd2fd.c b/src/dumpfd2fd.c index 542f82d3..61015607 100644 --- a/src/dumpfd2fd.c +++ b/src/dumpfd2fd.c @@ -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; }