aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhpa <hpa>2005-01-03 13:26:29 +0000
committerhpa <hpa>2005-01-03 13:26:29 +0000
commit5133e41f0d7e33ac4922880eb060d685224a5949 (patch)
tree6fe5906406d7b389cb57318b10aec3082ae0b90e
parentd375593d37579573a4e8104af39cc6f17f3ae4b3 (diff)
downloadsyslinux-elf-5133e41f0d7e33ac4922880eb060d685224a5949.tar.gz
syslinux-elf-5133e41f0d7e33ac4922880eb060d685224a5949.tar.xz
syslinux-elf-5133e41f0d7e33ac4922880eb060d685224a5949.zip
Allow compilation on systems without BLKGETSIZE64
-rw-r--r--extlinux/extlinux.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/extlinux/extlinux.c b/extlinux/extlinux.c
index 34c00f87..13f1f346 100644
--- a/extlinux/extlinux.c
+++ b/extlinux/extlinux.c
@@ -282,9 +282,12 @@ uint64_t get_size(int devfd)
uint32_t sects;
struct stat st;
+#ifdef BLKGETSIZE64
if ( !ioctl(devfd, BLKGETSIZE64, &bytes) )
return bytes;
- else if ( !ioctl(devfd, BLKGETSIZE, &sects) )
+#endif
+
+ if ( !ioctl(devfd, BLKGETSIZE, &sects) )
return (uint64_t)sects << 9;
else if ( !fstat(devfd, &st) && st.st_size )
return st.st_size;