]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
sfdisk: unused parameter 'sf' [-Wunused-parameter]
authorKarel Zak <kzak@redhat.com>
Thu, 5 Jan 2017 10:53:56 +0000 (11:53 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 5 Jan 2017 10:53:56 +0000 (11:53 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/sfdisk.c

index fb9fa499a60f92f42b3aee432cca9fbd5ee2d8e7..c6d57eacc7099475e984a935332fb3b5d3fb04c3 100644 (file)
@@ -1390,9 +1390,9 @@ static size_t last_pt_partno(struct sfdisk *sf)
        return partno;
 }
 
+#ifdef BLKRRPART
 static int is_device_used(struct sfdisk *sf)
 {
-#ifdef BLKRRPART
        struct stat st;
        int fd;
 
@@ -1406,9 +1406,14 @@ static int is_device_used(struct sfdisk *sf)
        if (fstat(fd, &st) == 0 && S_ISBLK(st.st_mode)
            && major(st.st_rdev) != LOOPDEV_MAJOR)
                return ioctl(fd, BLKRRPART) != 0;
-#endif
        return 0;
 }
+#else
+static int is_device_used(struct sfdisk *sf __attribute__((__unused__)))
+{
+       return 0;
+}
+#endif
 
 #ifdef HAVE_LIBREADLINE
 static char *sfdisk_fgets(struct fdisk_script *dp,