summaryrefslogtreecommitdiff
path: root/src/node_file.cc
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2018-02-03 21:58:22 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2018-02-08 21:38:00 +0800
commitb1c6ecb2c674f43290ad772bc464568aa42ef5d0 (patch)
tree21b8f518e6e4c05040317ba8e9fa6a1bc0bd4753 /src/node_file.cc
parente9b5b4fae3592f4d4992e0e4195fec8d65f57bf4 (diff)
downloadandroid-node-v8-b1c6ecb2c674f43290ad772bc464568aa42ef5d0.tar.gz
android-node-v8-b1c6ecb2c674f43290ad772bc464568aa42ef5d0.tar.bz2
android-node-v8-b1c6ecb2c674f43290ad772bc464568aa42ef5d0.zip
fs: fix misplaced errors in fs.symlinkSync
The ctx.error is supposed to be handled in fs.readlinkSync, but was handled in fs.symlinkSync by mistake. Also fix the error number check in readlink to be consistent with SYNC_CALL. PR-URL: https://github.com/nodejs/node/pull/18548 Refs: https://github.com/nodejs/node/pull/18348 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'src/node_file.cc')
-rw-r--r--src/node_file.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_file.cc b/src/node_file.cc
index a77dc0a986..62dd5fe80c 100644
--- a/src/node_file.cc
+++ b/src/node_file.cc
@@ -886,7 +886,7 @@ static void ReadLink(const FunctionCallbackInfo<Value>& args) {
fs_req_wrap req;
int err = SyncCall(env, args[3], &req, "readlink",
uv_fs_readlink, *path);
- if (err) {
+ if (err < 0) {
return; // syscall failed, no need to continue, error info is in ctx
}
const char* link_path = static_cast<const char*>(req.req.ptr);