summaryrefslogtreecommitdiffstats
path: root/disk-utils
diff options
context:
space:
mode:
authorKarel Zak2014-08-28 12:49:16 +0200
committerKarel Zak2014-08-28 12:49:16 +0200
commitc7119037f07541fb952f2989b99f89f7fc051b05 (patch)
tree5c16af16f8df1020ef6333c08a44cc3dc2172a05 /disk-utils
parentlibfdisk: extend dump parsing function (diff)
downloadkernel-qcow2-util-linux-c7119037f07541fb952f2989b99f89f7fc051b05.tar.gz
kernel-qcow2-util-linux-c7119037f07541fb952f2989b99f89f7fc051b05.tar.xz
kernel-qcow2-util-linux-c7119037f07541fb952f2989b99f89f7fc051b05.zip
libfdisk: use reference counting for context
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils')
-rw-r--r--disk-utils/cfdisk.c2
-rw-r--r--disk-utils/fdisk-menu.c8
-rw-r--r--disk-utils/fdisk.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c
index c259329c1..ef4e3ffb9 100644
--- a/disk-utils/cfdisk.c
+++ b/disk-utils/cfdisk.c
@@ -2100,7 +2100,7 @@ int main(int argc, char *argv[])
fdisk_unref_table(cf->table);
rc = fdisk_deassign_device(cf->cxt, cf->nwrites == 0);
- fdisk_free_context(cf->cxt);
+ fdisk_unref_context(cf->cxt);
DBG(MISC, ul_debug("bye! [rc=%d]", rc));
return rc == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}
diff --git a/disk-utils/fdisk-menu.c b/disk-utils/fdisk-menu.c
index c511b626e..efd8dc1c6 100644
--- a/disk-utils/fdisk-menu.c
+++ b/disk-utils/fdisk-menu.c
@@ -475,7 +475,7 @@ static int generic_menu_cb(struct fdisk_context **cxt0,
rc = fdisk_deassign_device(cxt, 0);
/* fallthrough */
case 'q':
- fdisk_free_context(cxt);
+ fdisk_unref_context(cxt);
fputc('\n', stdout);
exit(rc == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
case 'm':
@@ -543,7 +543,7 @@ static int generic_menu_cb(struct fdisk_context **cxt0,
*cxt0 = fdisk_get_parent(cxt);
fdisk_info(cxt, _("Leaving nested disklabel."));
- fdisk_free_context(cxt);
+ fdisk_unref_context(cxt);
cxt = *cxt0;
}
break;
@@ -649,7 +649,7 @@ static int dos_menu_cb(struct fdisk_context **cxt0,
if (!fdisk_has_label(bsd))
rc = fdisk_create_disklabel(bsd, "bsd");
if (rc)
- fdisk_free_context(bsd);
+ fdisk_unref_context(bsd);
else {
*cxt0 = cxt = bsd;
fdisk_sinfo(cxt, FDISK_INFO_SUCCESS,
@@ -683,7 +683,7 @@ static int dos_menu_cb(struct fdisk_context **cxt0,
*cxt0 = fdisk_get_parent(cxt);
fdisk_info(cxt, _("Leaving nested disklabel."));
- fdisk_free_context(cxt);
+ fdisk_unref_context(cxt);
cxt = *cxt0;
}
break;
diff --git a/disk-utils/fdisk.c b/disk-utils/fdisk.c
index 4f9d69454..c61e26399 100644
--- a/disk-utils/fdisk.c
+++ b/disk-utils/fdisk.c
@@ -74,7 +74,7 @@ int get_user_reply(struct fdisk_context *cxt, const char *prompt,
if (fgets(buf, bufsz, stdin) && !rpmatch(buf))
continue;
}
- fdisk_free_context(cxt);
+ fdisk_unref_context(cxt);
exit(EXIT_FAILURE);
} else
break;
@@ -1064,6 +1064,6 @@ int main(int argc, char **argv)
process_fdisk_menu(&cxt);
}
- fdisk_free_context(cxt);
+ fdisk_unref_context(cxt);
return EXIT_SUCCESS;
}