From: Karel Zak Date: Tue, 10 Apr 2012 10:29:10 +0000 (+0200) Subject: lib/blkdev: fix compiler warning [-Wreturn-type] X-Git-Tag: v2.22-rc1~543 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c344350948e80a3da04ecd8a88d82edcaf953fe2;p=thirdparty%2Futil-linux.git 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 --- diff --git a/lib/blkdev.c b/lib/blkdev.c index 198669bdab..9e13e13709 100644 --- a/lib/blkdev.c +++ b/lib/blkdev.c @@ -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