8266797: Fix for 8266610 breaks the build on macos

Reviewed-by: dholmes, jdv
This commit is contained in:
Vyom Tewari 2021-05-10 13:40:28 +00:00
parent 53db2a0acd
commit b823b3ef29

View file

@ -32,6 +32,9 @@
#if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(_AIX) #if defined(__linux__) || defined(_ALLBSD_SOURCE) || defined(_AIX)
#include <sys/ioctl.h> #include <sys/ioctl.h>
#endif
#if defined(__linux__)
#include <linux/fs.h> #include <linux/fs.h>
#include <sys/stat.h> #include <sys/stat.h>
#endif #endif
@ -250,7 +253,7 @@ handleGetLength(FD fd)
if (result < 0) { if (result < 0) {
return -1; return -1;
} }
#ifdef BLKGETSIZE64 #if defined(__linux__) && defined(BLKGETSIZE64)
if (S_ISBLK(sb.st_mode)) { if (S_ISBLK(sb.st_mode)) {
uint64_t size; uint64_t size;
if(ioctl(fd, BLKGETSIZE64, &size) < 0) { if(ioctl(fd, BLKGETSIZE64, &size) < 0) {