git://git.jankratochvil.net
/
captive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
38b8b9f
)
Use older 2TB-limited 'BLKGETSIZE' if 'BLKGETSIZE64' is not available.
author
short
<>
Fri, 22 Aug 2003 00:45:01 +0000
(
00:45
+0000)
committer
short
<>
Fri, 22 Aug 2003 00:45:01 +0000
(
00:45
+0000)
src/libcaptive/storage/size.c
patch
|
blob
|
history
diff --git
a/src/libcaptive/storage/size.c
b/src/libcaptive/storage/size.c
index
594c624
..
5348bb9
100644
(file)
--- a/
src/libcaptive/storage/size.c
+++ b/
src/libcaptive/storage/size.c
@@
-92,16
+92,27
@@
int fd;
static guint64 size_ioctl(GIOChannel *iochannel)
{
static guint64 size_ioctl(GIOChannel *iochannel)
{
-int fd
,err
;
+int fd;
guint64 r;
guint64 r;
+#ifndef BLKGETSIZE64
+long r_long;
+#endif
g_return_val_if_fail(iochannel!=NULL,0);
if (-1==(fd=iounixchannel_get_fd(iochannel)))
return 0;
g_return_val_if_fail(iochannel!=NULL,0);
if (-1==(fd=iounixchannel_get_fd(iochannel)))
return 0;
- if ((err=ioctl(fd,BLKGETSIZE64,&r)))
+#ifdef BLKGETSIZE64
+ if (ioctl(fd,BLKGETSIZE64,&r))
+ return 0;
+#else
+ if (ioctl(fd,BLKGETSIZE,&r_long))
+ return 0;
+ if (r_long<0)
return 0;
return 0;
+ r=((guint64)512)*r_long;
+#endif
return r;
}
return r;
}