summaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-open-flags.js
diff options
context:
space:
mode:
authorJussi Räsänen <jussir@gmail.com>2017-09-16 00:08:11 +0300
committerTobias Nießen <tniessen@tnie.de>2017-09-22 02:47:45 +0200
commit60460bf80dbba313759b0c6f73f8c17831b17e11 (patch)
tree89eec025a6df79ed8df77d0da41fb6efa98bc075 /test/parallel/test-fs-open-flags.js
parent66e45b821a3f70cfde7c6e2feda7e17a8607ae9c (diff)
downloadandroid-node-v8-60460bf80dbba313759b0c6f73f8c17831b17e11.tar.gz
android-node-v8-60460bf80dbba313759b0c6f73f8c17831b17e11.tar.bz2
android-node-v8-60460bf80dbba313759b0c6f73f8c17831b17e11.zip
fs: add O_DSYNC
PR-URL: https://github.com/nodejs/node/pull/15451 Fixes: https://github.com/nodejs/node/issues/15425 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'test/parallel/test-fs-open-flags.js')
-rw-r--r--test/parallel/test-fs-open-flags.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/parallel/test-fs-open-flags.js b/test/parallel/test-fs-open-flags.js
index 873bd71128..f480ede4e3 100644
--- a/test/parallel/test-fs-open-flags.js
+++ b/test/parallel/test-fs-open-flags.js
@@ -22,6 +22,7 @@
// Flags: --expose_internals
'use strict';
const common = require('../common');
+const fixtures = require('../common/fixtures');
const assert = require('assert');
const fs = require('fs');
@@ -32,6 +33,7 @@ const O_EXCL = fs.constants.O_EXCL || 0;
const O_RDONLY = fs.constants.O_RDONLY || 0;
const O_RDWR = fs.constants.O_RDWR || 0;
const O_SYNC = fs.constants.O_SYNC || 0;
+const O_DSYNC = fs.constants.O_DSYNC || 0;
const O_TRUNC = fs.constants.O_TRUNC || 0;
const O_WRONLY = fs.constants.O_WRONLY || 0;
@@ -78,3 +80,11 @@ common.expectsError(
() => stringToFlags(null),
{ code: 'ERR_INVALID_OPT_VALUE', type: TypeError }
);
+
+if (common.isLinux === true) {
+ const file = fixtures.path('a.js');
+
+ fs.open(file, O_DSYNC, common.mustCall(function(err, fd) {
+ assert.ifError(err);
+ }));
+}