unix: use fchmod() in uv_fs_copyfile()
This commit introduces fchmod() in uv_fs_copyfile() to set the mode of the destination file. Refs: https://github.com/nodejs/node/issues/15394 PR-URL: https://github.com/libuv/libuv/pull/1547 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit is contained in:
parent
6ad1e81547
commit
eaf25ae3eb
@ -828,6 +828,11 @@ static ssize_t uv__fs_copyfile(uv_fs_t* req) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (fchmod(dstfd, statsbuf.st_mode) == -1) {
|
||||
err = -errno;
|
||||
goto out;
|
||||
}
|
||||
|
||||
bytes_to_send = statsbuf.st_size;
|
||||
in_offset = 0;
|
||||
while (bytes_to_send != 0) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user