Skip to content

Commit 25694d7

Browse files
author
sendaoYan
committed
merge Linker.nativeLinker().defaultLookup().find("statx").isPresent() and !Files.getFileStore(file).type().contentEquals("tmpfs")
1 parent 128e686 commit 25694d7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/jdk/java/nio/file/attribute/BasicFileAttributeView/CreationTime.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,12 @@ static void test(Path top) throws IOException {
106106
supportsCreationTimeWrite = true;
107107
}
108108
} else if (Platform.isLinux()) {
109-
// Creation time read depends on statx system call support
110-
supportsCreationTimeRead = Linker.nativeLinker().defaultLookup().find("statx").isPresent();
111-
// Linux system doesn't support birth time on tmpfs filesystem for now
112-
if( Files.getFileStore(file).type().contentEquals("tmpfs") ) {
113-
supportsCreationTimeRead = false;
109+
// Creation time read depends on statx system call support and on the file
110+
// system storing the birth time. The tmpfs file system type does not store
111+
// the birth time.
112+
boolean statxIsPresent = Linker.nativeLinker().defaultLookup().find("statx").isPresent();
113+
if (statxIsPresent && !Files.getFileStore(file).type().contentEquals("tmpfs")) {
114+
supportsCreationTimeRead = true;
114115
}
115116
// Creation time updates are not supported on Linux
116117
supportsCreationTimeWrite = false;

0 commit comments

Comments
 (0)