mirror of
https://github.com/adulau/dcfldd.git
synced 2024-12-22 16:56:03 +00:00
Debian fix-probing-of-large-block-devices.patch added
This commit is contained in:
parent
feec8b846e
commit
0ffc12ec0f
1 changed files with 7 additions and 3 deletions
10
sizeprobe.c
10
sizeprobe.c
|
@ -63,9 +63,13 @@ static off_t midpoint(off_t a, off_t b, long blksize)
|
||||||
static off_t get_dev_size(int fd, long blksize)
|
static off_t get_dev_size(int fd, long blksize)
|
||||||
{
|
{
|
||||||
off_t num_sectors = 0;
|
off_t num_sectors = 0;
|
||||||
|
|
||||||
if (ioctl(fd, BLKGETSIZE, &num_sectors))
|
/*
|
||||||
log_info("%s: ioctl call to BLKGETSIZE failed.\n", program_name);
|
* Use BLKGETSIZE64 unconditionally, since dcfldd.h #defines _FILE_OFFSET_BITS 64
|
||||||
|
* and off_t is guaranteed to be large enough to hold the result.
|
||||||
|
*/
|
||||||
|
if (ioctl(fd, BLKGETSIZE64, &num_sectors))
|
||||||
|
log_info("%s: ioctl call to BLKGETSIZE64 failed.\n", program_name);
|
||||||
else
|
else
|
||||||
return (num_sectors * 512);
|
return (num_sectors * 512);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue