Skip to content

Commit 6b40ba1

Browse files
jBarztargos
authored andcommitted
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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 50f833d commit 6b40ba1

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)