diff options
author | Karel Zak | 2012-05-23 11:24:04 +0200 |
---|---|---|
committer | Karel Zak | 2012-05-23 11:24:04 +0200 |
commit | 7657d3e217edd89f220fef4008aafd4a7a970193 (patch) | |
tree | 17170fdfbeaa01ad8d2f1084452920ecac7d8ad1 /fdisk/fdisk.c | |
parent | fdisk: always use stderr for debug messages (diff) | |
download | kernel-qcow2-util-linux-7657d3e217edd89f220fef4008aafd4a7a970193.tar.gz kernel-qcow2-util-linux-7657d3e217edd89f220fef4008aafd4a7a970193.tar.xz kernel-qcow2-util-linux-7657d3e217edd89f220fef4008aafd4a7a970193.zip |
fdisk: add readonly option to fdisk_new_context_from_filename()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'fdisk/fdisk.c')
-rw-r--r-- | fdisk/fdisk.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fdisk/fdisk.c b/fdisk/fdisk.c index aac41a1ed..e5cc90ede 100644 --- a/fdisk/fdisk.c +++ b/fdisk/fdisk.c @@ -1927,7 +1927,7 @@ print_partition_table_from_option(char *device) { int gb; - cxt = fdisk_new_context_from_filename(device); + cxt = fdisk_new_context_from_filename(device, 1); /* read-only */ if (!cxt) err(EXIT_FAILURE, _("unable to open %s"), device); @@ -1941,6 +1941,7 @@ print_partition_table_from_option(char *device) else if (!gb) list_table(0); fdisk_free_context(cxt); + cxt = NULL; } /* @@ -2203,7 +2204,7 @@ int main(int argc, char **argv) } if (argc-optind == 1) { - cxt = fdisk_new_context_from_filename(argv[optind]); + cxt = fdisk_new_context_from_filename(argv[optind], 0); if (!cxt) err(EXIT_FAILURE, _("unable to open %s"), argv[optind]); } |