summaryrefslogtreecommitdiffstats
path: root/lib/blkdev.c
diff options
context:
space:
mode:
authorRuediger Meier2017-06-29 04:09:07 +0200
committerKarel Zak2017-06-29 12:56:22 +0200
commitad553030fbaa2654e3ec8e9524b096eae6b57b21 (patch)
treec2f0bdb7e4596fae9fdfb1efe4fdecc55f9c8f5e /lib/blkdev.c
parentdocs: remove some old history from manpages (diff)
downloadkernel-qcow2-util-linux-ad553030fbaa2654e3ec8e9524b096eae6b57b21.tar.gz
kernel-qcow2-util-linux-ad553030fbaa2654e3ec8e9524b096eae6b57b21.tar.xz
kernel-qcow2-util-linux-ad553030fbaa2654e3ec8e9524b096eae6b57b21.zip
lib/blkdev: remove support for Linux < 2.6
Remove a hack for kernels between 2.4.15 and 2.4.17 Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'lib/blkdev.c')
-rw-r--r--lib/blkdev.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/blkdev.c b/lib/blkdev.c
index 2b62f09d8..0616142b8 100644
--- a/lib/blkdev.c
+++ b/lib/blkdev.c
@@ -91,18 +91,9 @@ blkdev_get_size(int fd, unsigned long long *bytes)
#endif
#ifdef BLKGETSIZE64
- {
-#ifdef __linux__
- int ver = get_linux_version();
-
- /* kernels 2.4.15-2.4.17, had a broken BLKGETSIZE64 */
- if (ver >= KERNEL_VERSION (2,6,0) ||
- (ver >= KERNEL_VERSION (2,4,18) && ver < KERNEL_VERSION (2,5,0)))
+ if (ioctl(fd, BLKGETSIZE64, bytes) >= 0)
+ return 0;
#endif
- if (ioctl(fd, BLKGETSIZE64, bytes) >= 0)
- return 0;
- }
-#endif /* BLKGETSIZE64 */
#ifdef BLKGETSIZE
{