unix: check for EXDEV in uv__fs_sendfile()
copy_file_range will not work when in_fd and out_fd are not on the same mounted filesystem (pre Linux 5.3). Refs: https://github.com/nodejs/node/issues/37284 PR-URL: https://github.com/libuv/libuv/pull/3108 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
This commit is contained in:
parent
217fdf4265
commit
70f67d8e05
@ -926,8 +926,10 @@ static ssize_t uv__fs_sendfile(uv_fs_t* req) {
|
||||
/* ENOSYS - it will never work */
|
||||
errno = 0;
|
||||
copy_file_range_support = 0;
|
||||
} else if (r == -1 && errno == ENOTSUP) {
|
||||
} else if (r == -1 && (errno == ENOTSUP || errno == EXDEV)) {
|
||||
/* ENOTSUP - it could work on another file system type */
|
||||
/* EXDEV - it will not work when in_fd and out_fd are not on the same
|
||||
mounted filesystem (pre Linux 5.3) */
|
||||
errno = 0;
|
||||
} else {
|
||||
goto ok;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user