../lib/blkdev.c: In function ‘blkdev_get_geometry’:
../lib/blkdev.c:287:1: warning: control reaches end of non-void function [-Wreturn-type]
Signed-off-by: Karel Zak <kzak@redhat.com>
#ifdef HDIO_GETGEO
struct hd_geometry geometry;
- if (!ioctl(fd, HDIO_GETGEO, &geometry)) {
+ if (ioctl(fd, HDIO_GETGEO, &geometry) == 0) {
*h = geometry.heads;
*s = geometry.sectors;
+ return 0;
}
#else
*h = 0;
*s = 0;
#endif
+ return -1;
}
#ifdef TEST_PROGRAM