Skip to content

Commit 1ca8dd0

Browse files
author
sendaoYan
committed
STATX_BTIME return statx buffer mask convert to boolean explicitly, and add comment to explain why get STATX_BTIME bit
1 parent be64c32 commit 1ca8dd0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/jdk/java/nio/file/attribute/BasicFileAttributeView/libCreationTimeHelper.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ EXPORT bool linuxIsCreationTimeSupported(char* file) {
115115
if (ret != 0) {
116116
return false;
117117
}
118-
if (stx.stx_mask & STATX_BTIME)
118+
// On some systems where statx is available but birth time might still not
119+
// be supported as it's file system specific. The only reliable way to
120+
// check for supported or not is looking at the filled in STATX_BTIME bit
121+
// in the returned statx buffer mask.
122+
if ((stx.stx_mask & STATX_BTIME) != 0)
119123
return true;
120124
return false;
121125
#else

0 commit comments

Comments
 (0)