Skip to content

Commit 5928b39

Browse files
committed
INVALID_FILE_SIZE
1 parent 853a9de commit 5928b39

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/src/main/java/org/elasticsearch/common/filesystem/WindowsFileSystemNatives.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ final class WindowsFileSystemNatives implements FileSystemNatives.Provider {
2929

3030
private static final WindowsFileSystemNatives INSTANCE = new WindowsFileSystemNatives();
3131

32+
private static final int INVALID_FILE_SIZE = -1;
33+
3234
private WindowsFileSystemNatives() {
3335
assert Constants.WINDOWS : Constants.OS_NAME;
3436
try {
@@ -71,7 +73,7 @@ public OptionalLong allocatedSizeInBytes(Path path) {
7173
final IntByReference lpFileSizeHigh = new IntByReference();
7274

7375
final int lpFileSizeLow = GetCompressedFileSizeW(fileName, lpFileSizeHigh);
74-
if (lpFileSizeLow == 0xffffffff) {
76+
if (lpFileSizeLow == INVALID_FILE_SIZE) {
7577
final int err = Native.getLastError();
7678
logger.warn("error [{}] when executing native method GetCompressedFileSizeW for file [{}]", err, path);
7779
return OptionalLong.empty();

0 commit comments

Comments
 (0)