Skip to content

Commit

Permalink
test: avoid running fsync on directory on AIX
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jBarz authored and BethGriggs committed Mar 21, 2019
1 parent 97cc0fc commit 3128cb7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/parallel/test-fs-utimes.js
Expand Up @@ -35,7 +35,11 @@ function stat_resource(resource) {
if (typeof resource === 'string') {
return fs.statSync(resource);
} else {
const stats = fs.fstatSync(resource);
// ensure mtime has been written to disk
// except for directories on AIX where it cannot be synced
if (common.isAIX && stats.isDirectory())
return stats;
fs.fsyncSync(resource);
return fs.fstatSync(resource);
}
Expand Down

0 comments on commit 3128cb7

Please sign in to comment.