Pass the correct size argument to ioctl(DIOCGSECTORSIZE)

This commit is contained in:
Poul-Henning Kamp 2016-11-22 22:10:58 +00:00
parent ab950d2d18
commit e10312ca7b

View File

@ -45,6 +45,7 @@ fifolog_create(const char *fn, off_t size, ssize_t recsize)
{
int i, fd;
ssize_t u;
u_int uu;
off_t ms;
struct stat st;
char *buf;
@ -79,7 +80,8 @@ fifolog_create(const char *fn, off_t size, ssize_t recsize)
}
/* For raw disk with larger sectors: use 1 sector */
i = ioctl(fd, DIOCGSECTORSIZE, &u);
i = ioctl(fd, DIOCGSECTORSIZE, &uu);
u = uu;
if (i == 0 && (u > recsize || (recsize % u) != 0))
recsize = u;