From: short <> Date: Wed, 5 Nov 2003 06:26:08 +0000 (+0000) Subject: Fixed 'BLKGETSIZE64' incompatibility for Debian-unstable. X-Git-Tag: captive-1_0_2~17 X-Git-Url: http://git.jankratochvil.net/?p=captive.git;a=commitdiff_plain;h=b6793bdbe590024910470fd34c337ce6dd9e152f Fixed 'BLKGETSIZE64' incompatibility for Debian-unstable. - FIXME: 'BLKGETSIZE64' usually not used at all now. - Fix introduces media size limit of 1TB. --- diff --git a/src/libcaptive/storage/size.c b/src/libcaptive/storage/size.c index 5348bb9..b70af55 100644 --- a/src/libcaptive/storage/size.c +++ b/src/libcaptive/storage/size.c @@ -27,9 +27,10 @@ #include #include #include -#include /* for __u64 for u64 for BLKGETSIZE64 */ -#define u64 __u64 -#include /* for BLKGETSIZE64 */ +/* Do not: #include * for 'BLKGETSIZE64' * + * as including any Linux kernel include files is too much incompatible. + */ +#include /* for 'BLKGETSIZE' */ static guint64 size_blind(GIOChannel *iochannel) @@ -94,9 +95,7 @@ static guint64 size_ioctl(GIOChannel *iochannel) { int fd; guint64 r; -#ifndef BLKGETSIZE64 long r_long; -#endif g_return_val_if_fail(iochannel!=NULL,0); @@ -104,15 +103,14 @@ long r_long; return 0; #ifdef BLKGETSIZE64 - if (ioctl(fd,BLKGETSIZE64,&r)) - return 0; -#else + if (!ioctl(fd,BLKGETSIZE64,&r)) + return r; +#endif if (ioctl(fd,BLKGETSIZE,&r_long)) return 0; if (r_long<0) return 0; r=((guint64)512)*r_long; -#endif return r; }