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:
parent
9c45d49fe0
commit
c344350948
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue