aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2018-02-28 01:45:17 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2018-03-02 21:13:24 +0800
commit1650eaeac4d344a21f08923dc39ab09637f71ab8 (patch)
tree93abc12cc53f9dcca6d70fc9f4292e1b9996952d /lib
parent79b195437c007162e0ebf5b24f3f38f8d369e267 (diff)
downloadandroid-node-v8-1650eaeac4d344a21f08923dc39ab09637f71ab8.tar.gz
android-node-v8-1650eaeac4d344a21f08923dc39ab09637f71ab8.tar.bz2
android-node-v8-1650eaeac4d344a21f08923dc39ab09637f71ab8.zip
fs: throw fchownSync errors in JS
PR-URL: https://github.com/nodejs/node/pull/19041 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/fs.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/fs.js b/lib/fs.js
index 2cafcefc53..0671a05ae0 100644
--- a/lib/fs.js
+++ b/lib/fs.js
@@ -1110,7 +1110,9 @@ fs.fchownSync = function(fd, uid, gid) {
validateUint32(uid, 'uid');
validateUint32(gid, 'gid');
- return binding.fchown(fd, uid, gid);
+ const ctx = {};
+ binding.fchown(fd, uid, gid, undefined, ctx);
+ handleErrorFromBinding(ctx);
};
fs.chown = function(path, uid, gid, callback) {