Skip to content

Commit 3128cb7

Browse files
jBarzBethGriggs
authored andcommittedMar 21, 2019
test: avoid running fsync on directory on AIX
On AIX the underlying fsync system call returns EBADF on a file descriptor for an open directory. So avoid running fsync on it. PR-URL: #21298 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Signed-off-by: Beth Griggs <Bethany.Griggs@uk.ibm.com>
1 parent 97cc0fc commit 3128cb7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎test/parallel/test-fs-utimes.js

+4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ function stat_resource(resource) {
3535
if (typeof resource === 'string') {
3636
return fs.statSync(resource);
3737
} else {
38+
const stats = fs.fstatSync(resource);
3839
// ensure mtime has been written to disk
40+
// except for directories on AIX where it cannot be synced
41+
if (common.isAIX && stats.isDirectory())
42+
return stats;
3943
fs.fsyncSync(resource);
4044
return fs.fstatSync(resource);
4145
}

0 commit comments

Comments
 (0)
Please sign in to comment.