From 60231ba41237541500464c2298bf93e67d793d77 Mon Sep 17 00:00:00 2001 From: "cantab.net!aia21" Date: Wed, 17 Mar 2004 12:22:03 +0000 Subject: [PATCH] - Fix to include sys/ioctl.h. - Define the ioctls we use if they are not defined, as it is done in device.c. (Logical change 1.336) --- ntfsprogs/ntfsclone.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ntfsprogs/ntfsclone.c b/ntfsprogs/ntfsclone.c index e96da3b7..1f244f19 100644 --- a/ntfsprogs/ntfsclone.c +++ b/ntfsprogs/ntfsclone.c @@ -18,6 +18,7 @@ #include #include #include +#include #ifdef HAVE_SYS_VFS_H # include #endif @@ -41,6 +42,13 @@ #include "runlist.h" #include "utils.h" +#if defined(linux) && defined(_IO) && !defined(BLKGETSIZE) +#define BLKGETSIZE _IO(0x12,96) /* Get device size in 512-byte blocks. */ +#endif +#if defined(linux) && defined(_IOR) && !defined(BLKGETSIZE64) +#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* Get device size in bytes. */ +#endif + static const char *EXEC_NAME = "ntfsclone"; struct { @@ -910,7 +918,7 @@ static s64 device_size_get(int fd) Dprintf("BLKGETSIZE64 nr bytes = %llu (0x%llx)\n", (unsigned long long)size, (unsigned long long)size); - return (s64)size / block_size; + return (s64)size; } } #endif