diff options
author | hpa <hpa> | 2005-01-03 13:26:29 +0000 |
---|---|---|
committer | hpa <hpa> | 2005-01-03 13:26:29 +0000 |
commit | 5133e41f0d7e33ac4922880eb060d685224a5949 (patch) | |
tree | 6fe5906406d7b389cb57318b10aec3082ae0b90e | |
parent | d375593d37579573a4e8104af39cc6f17f3ae4b3 (diff) | |
download | syslinux-elf-5133e41f0d7e33ac4922880eb060d685224a5949.tar.gz syslinux-elf-5133e41f0d7e33ac4922880eb060d685224a5949.tar.xz syslinux-elf-5133e41f0d7e33ac4922880eb060d685224a5949.zip |
Allow compilation on systems without BLKGETSIZE64
-rw-r--r-- | extlinux/extlinux.c | 5 |
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, §s) ) +#endif + + if ( !ioctl(devfd, BLKGETSIZE, §s) ) return (uint64_t)sects << 9; else if ( !fstat(devfd, &st) && st.st_size ) return st.st_size; |