Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8266797: Fix for 8266610 breaks the build on macos
Reviewed-by: dholmes, jdv
  • Loading branch information
Vyom Tewari committed May 10, 2021
1 parent 53db2a0 commit b823b3e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/java.base/unix/native/libjava/io_util_md.c
Expand Up @@ -32,6 +32,9 @@

#if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(_AIX)
#include <sys/ioctl.h>
#endif

#if defined(__linux__)
#include <linux/fs.h>
#include <sys/stat.h>
#endif
Expand Down Expand Up @@ -250,14 +253,14 @@ handleGetLength(FD fd)
if (result < 0) {
return -1;
}
#ifdef BLKGETSIZE64
#if defined(__linux__) && defined(BLKGETSIZE64)
if (S_ISBLK(sb.st_mode)) {
uint64_t size;
if(ioctl(fd, BLKGETSIZE64, &size) < 0) {
return -1;
}
return (jlong)size;
}
#endif
#endif
return sb.st_size;
}

1 comment on commit b823b3e

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.