diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2018-01-24 09:37:52 +0800 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2018-02-01 15:52:40 +0800 |
commit | f5e287ba208b8d9eed3c850577ff9a46d9935d9a (patch) | |
tree | d7cc63fb647561a427214d5c4695d40670020fc4 /lib | |
parent | b3a7df7c6dddcc4aaf2106d569a2a4c017e9699c (diff) | |
download | android-node-v8-f5e287ba208b8d9eed3c850577ff9a46d9935d9a.tar.gz android-node-v8-f5e287ba208b8d9eed3c850577ff9a46d9935d9a.tar.bz2 android-node-v8-f5e287ba208b8d9eed3c850577ff9a46d9935d9a.zip |
fs: throw errors from fs.fdatasyncSync 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.js | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1029,7 +1029,11 @@ fs.fdatasync = function(fd, callback) { fs.fdatasyncSync = function(fd) { validateUint32(fd, 'fd'); - return binding.fdatasync(fd); + const ctx = {}; + binding.fdatasync(fd, undefined, ctx); + if (ctx.errno !== undefined) { + throw new errors.uvException(ctx); + } }; fs.fsync = function(fd, callback) { |