lib/blkdev: fix compiler warning [-Wreturn-type]

../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>
This commit is contained in:
Karel Zak 2012-04-10 12:29:10 +02:00
parent 9c45d49fe0
commit c344350948
1 changed files with 3 additions and 1 deletions

View File

@ -276,14 +276,16 @@ int blkdev_get_geometry(int fd, unsigned int *h, unsigned int *s)
#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