summaryrefslogtreecommitdiffstats
path: root/disk-utils/sfdisk.c
diff options
context:
space:
mode:
authorKarel Zak2017-01-05 11:53:56 +0100
committerKarel Zak2017-01-05 11:53:56 +0100
commit11e1097e6c6d499228c84609523d8d1976be21a3 (patch)
tree56ad708ae1cf24492eb3335c43d048d530a37d60 /disk-utils/sfdisk.c
parentMerge branch 'fixMinixMkfs' of https://github.com/n3world/util-linux (diff)
downloadkernel-qcow2-util-linux-11e1097e6c6d499228c84609523d8d1976be21a3.tar.gz
kernel-qcow2-util-linux-11e1097e6c6d499228c84609523d8d1976be21a3.tar.xz
kernel-qcow2-util-linux-11e1097e6c6d499228c84609523d8d1976be21a3.zip
sfdisk: unused parameter 'sf' [-Wunused-parameter]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils/sfdisk.c')
-rw-r--r--disk-utils/sfdisk.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c
index fb9fa499a..c6d57eacc 100644
--- a/disk-utils/sfdisk.c
+++ b/disk-utils/sfdisk.c
@@ -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,