Debian fix-probing-of-large-block-devices.patch added

This commit is contained in:
Alexandre Dulaunoy 2014-11-26 21:55:23 +01:00
parent feec8b846e
commit 0ffc12ec0f

View file

@ -64,8 +64,12 @@ static off_t get_dev_size(int fd, long blksize)
{
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
return (num_sectors * 512);
}