1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-27 08:00:11 +00:00

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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=309025

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;