summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2018-01-24 18:39:35 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2018-02-01 15:52:46 +0800
commiteca93e631f4c080ca72a762bfa3b214aef3af48a (patch)
treeb88e85739fe5fe9864765715908548e1c307e604 /lib
parentf5e287ba208b8d9eed3c850577ff9a46d9935d9a (diff)
downloadandroid-node-v8-eca93e631f4c080ca72a762bfa3b214aef3af48a.tar.gz
android-node-v8-eca93e631f4c080ca72a762bfa3b214aef3af48a.tar.bz2
android-node-v8-eca93e631f4c080ca72a762bfa3b214aef3af48a.zip
fs: throw errors from fs.fsyncSync in JS
PR-URL: https://github.com/nodejs/node/pull/18348 Refs: https://github.com/nodejs/node/issues/18106 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.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/fs.js b/lib/fs.js
index 49e550fe3d..e3801d30db 100644
--- a/lib/fs.js
+++ b/lib/fs.js
@@ -1045,7 +1045,11 @@ fs.fsync = function(fd, callback) {
fs.fsyncSync = function(fd) {
validateUint32(fd, 'fd');
- return binding.fsync(fd);
+ const ctx = {};
+ binding.fsync(fd, undefined, ctx);
+ if (ctx.errno !== undefined) {
+ throw new errors.uvException(ctx);
+ }
};
fs.mkdir = function(path, mode, callback) {