Skip to content

Commit b823b3e

Browse files
author
Vyom Tewari
committed
8266797: Fix for 8266610 breaks the build on macos
Reviewed-by: dholmes, jdv
1 parent 53db2a0 commit b823b3e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/java.base/unix/native/libjava/io_util_md.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232

3333
#if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(_AIX)
3434
#include <sys/ioctl.h>
35+
#endif
36+
37+
#if defined(__linux__)
3538
#include <linux/fs.h>
3639
#include <sys/stat.h>
3740
#endif
@@ -250,14 +253,14 @@ handleGetLength(FD fd)
250253
if (result < 0) {
251254
return -1;
252255
}
253-
#ifdef BLKGETSIZE64
256+
#if defined(__linux__) && defined(BLKGETSIZE64)
254257
if (S_ISBLK(sb.st_mode)) {
255258
uint64_t size;
256259
if(ioctl(fd, BLKGETSIZE64, &size) < 0) {
257260
return -1;
258261
}
259262
return (jlong)size;
260263
}
261-
#endif
264+
#endif
262265
return sb.st_size;
263266
}

0 commit comments

Comments
 (0)