mirror of
https://github.com/ggrandou/abootimg.git
synced 2024-12-03 23:05:42 +08:00
fix - block device support was broken...
bad pointer dereferencing in ioctl call
This commit is contained in:
parent
63ad881fac
commit
1fb6383d76
@ -107,18 +107,18 @@ void abort_printf(char *fmt, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int blkgetsize(int fd, unsigned long long *bsize)
|
int blkgetsize(int fd, unsigned long long *pbsize)
|
||||||
{
|
{
|
||||||
# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
return ioctl(fd, DIOCGMEDIASIZE, &bsize);
|
return ioctl(fd, DIOCGMEDIASIZE, pbsize);
|
||||||
# elif defined(__APPLE__)
|
# elif defined(__APPLE__)
|
||||||
return ioctl(fd, DKIOCGETBLOCKCOUNT, &bsize);
|
return ioctl(fd, DKIOCGETBLOCKCOUNT, pbsize);
|
||||||
# elif defined(__NetBSD__)
|
# elif defined(__NetBSD__)
|
||||||
// does a suitable ioctl exist?
|
// does a suitable ioctl exist?
|
||||||
// return (ioctl(fd, DIOCGDINFO, &label) == -1);
|
// return (ioctl(fd, DIOCGDINFO, &label) == -1);
|
||||||
return 1;
|
return 1;
|
||||||
# elif defined(__linux__) || defined(__CYGWIN__)
|
# elif defined(__linux__) || defined(__CYGWIN__)
|
||||||
return ioctl(fd, BLKGETSIZE64, &bsize);
|
return ioctl(fd, BLKGETSIZE64, pbsize);
|
||||||
# elif defined(__GNU__)
|
# elif defined(__GNU__)
|
||||||
// does a suitable ioctl for HURD exist?
|
// does a suitable ioctl for HURD exist?
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user