]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/blkdev: fix compiler warning [-Wreturn-type]
authorKarel Zak <kzak@redhat.com>
Tue, 10 Apr 2012 10:29:10 +0000 (12:29 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 10 Apr 2012 10:29:10 +0000 (12:29 +0200)
../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>
lib/blkdev.c

index 198669bdab490f2340b13db3d4225dd247559db3..9e13e13709d984af950481262b15ac4ac784cc7b 100644 (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