Original commit message:

    unix: treat futimens() as best-effort in copyfile

    futimens() may fail with EPERM on CIFS/SMB shares that do not
    support setting timestamps. Since preserving timestamps during
    copyfile is best-effort, ignore the return value unconditionally.

    Refs: https://github.com/libuv/libuv/pull/4396

Fixes: https://github.com/nodejs/node/issues/56248
PR-URL: https://github.com/nodejs/node/pull/62881
Refs: https://github.com/libuv/libuv/pull/5053
Refs: https://github.com/libuv/libuv/pull/4396
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
This commit is contained in:
skooch authored and Antoine du Hamel committed 2026-05-07 15:41:46 +02:00
1 parent 1a60851734
commit 01dfe5961c
1 file changed
+1 -4
+1 -4
View File
@@ -1324,10 +1324,7 @@ static ssize_t uv__fs_copyfile(uv_fs_t* req) {
times[1] = src_statsbuf.st_mtim;
#endif
if (futimens(dstfd, times) == -1) {
err = UV__ERR(errno);
goto out;
}
(void) futimens(dstfd, times);
/*
* Change the ownership and permissions of the destination file to match the