Skip to content

Commit

Permalink
unix: set errno in uv_fs_copyfile()
Browse files Browse the repository at this point in the history
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: nodejs/node#21329
PR-URL: libuv#1881
Reviewed-By: Santiago Gimeno <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
  • Loading branch information
cjihrig committed Jun 14, 2018
1 parent 0cdb4a5 commit 96d38d9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/unix/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,11 @@ static ssize_t uv__fs_copyfile(uv_fs_t* req) {
}
}

return result;
if (result == 0)
return 0;

errno = UV__ERR(result);
return -1;
#endif
}

Expand Down

0 comments on commit 96d38d9

Please sign in to comment.