From: hpa Date: Mon, 3 Jan 2005 13:26:29 +0000 (+0000) Subject: Allow compilation on systems without BLKGETSIZE64 X-Git-Tag: syslinux-3.11~167 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5133e41f0d7e33ac4922880eb060d685224a5949;p=platform%2Fupstream%2Fsyslinux.git Allow compilation on systems without BLKGETSIZE64 --- diff --git a/extlinux/extlinux.c b/extlinux/extlinux.c index 34c00f8..13f1f34 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;