summaryrefslogtreecommitdiffstats
path: root/disk-utils
diff options
context:
space:
mode:
authorKarel Zak2018-07-23 11:43:30 +0200
committerKarel Zak2018-07-23 11:43:30 +0200
commitf11157e80412da35017fda9cc16984f47b94f542 (patch)
treefb7f51c8aa95175cfaa1763d3e8f1769765704c1 /disk-utils
parentlibfdisk: fix compiler warnings [-Wcast-qual] (diff)
downloadkernel-qcow2-util-linux-f11157e80412da35017fda9cc16984f47b94f542.tar.gz
kernel-qcow2-util-linux-f11157e80412da35017fda9cc16984f47b94f542.tar.xz
kernel-qcow2-util-linux-f11157e80412da35017fda9cc16984f47b94f542.zip
mkswap: fix compiler warnings [-Wcast-qual]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils')
-rw-r--r--disk-utils/mkswap.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c
index a6077daf0..cbb99dccb 100644
--- a/disk-utils/mkswap.c
+++ b/disk-utils/mkswap.c
@@ -259,6 +259,8 @@ static void wipe_device(struct mkswap_control *ctl)
blkid_probe pr = NULL;
#endif
if (!ctl->force) {
+ const char *v = NULL;
+
if (lseek(ctl->fd, 0, SEEK_SET) != 0)
errx(EXIT_FAILURE, _("unable to rewind swap-device"));
@@ -268,9 +270,8 @@ static void wipe_device(struct mkswap_control *ctl)
blkid_probe_enable_superblocks(pr, 0);
if (blkid_do_fullprobe(pr) == 0 &&
- blkid_probe_lookup_value(pr, "PTTYPE",
- (const char **) &type, NULL) == 0 && type) {
- type = xstrdup(type);
+ blkid_probe_lookup_value(pr, "PTTYPE", &v, NULL) == 0 && v) {
+ type = xstrdup(v);
zap = 0;
}
#else