unix: set errno in uv_fs_copyfile()

When the specific value of -1 is returned, uv__fs_work() uses
the value of errno. This commit sets errno in uv__fs_copyfile().

Fixes: https://github.com/nodejs/node/issues/21329
PR-URL: https://github.com/libuv/libuv/pull/1881
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
cjihrig 2018-06-14 11:13:47 -04:00
parent 1a0f619530
commit e179bd1b43
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5

View File

@ -929,7 +929,11 @@ out:
}
}
return result;
if (result == 0)
return 0;
errno = UV__ERR(result);
return -1;
#endif
}