summaryrefslogtreecommitdiffstats
path: root/fdisk/fdisk.c
diff options
context:
space:
mode:
authorFrancesco Cosoleto2011-12-15 20:02:41 +0100
committerKarel Zak2011-12-16 14:04:02 +0100
commitea4824f1ad7940bb950d55ba50ae5bee916a888d (patch)
treeba51c4aaf8fb27b1c2986f3207859a82eb688c73 /fdisk/fdisk.c
parentfdisk: drop one parameter from try() function (diff)
downloadkernel-qcow2-util-linux-ea4824f1ad7940bb950d55ba50ae5bee916a888d.tar.gz
kernel-qcow2-util-linux-ea4824f1ad7940bb950d55ba50ae5bee916a888d.tar.xz
kernel-qcow2-util-linux-ea4824f1ad7940bb950d55ba50ae5bee916a888d.zip
fdisk: rename try() and tryprocpt() functions
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
Diffstat (limited to 'fdisk/fdisk.c')
-rw-r--r--fdisk/fdisk.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/fdisk/fdisk.c b/fdisk/fdisk.c
index 1ecab1780..a8a18009a 100644
--- a/fdisk/fdisk.c
+++ b/fdisk/fdisk.c
@@ -2799,8 +2799,10 @@ gpt_warning(char *dev)
"The util fdisk doesn't support GPT. Use GNU Parted.\n\n"), dev);
}
+/* Print disk geometry and partition table of a specified device (-l option) */
+
static void
-try(char *device)
+print_partition_table_from_option(char *device)
{
int gb;
@@ -2837,7 +2839,8 @@ try(char *device)
* try all things in /proc/partitions that look like a full disk
*/
static void
-tryprocpt(void) {
+print_all_partition_table_from_option(void)
+{
FILE *procpt;
char line[128], ptname[128], devname[256];
int ma, mi;
@@ -2857,7 +2860,7 @@ tryprocpt(void) {
if (is_whole_disk(devname)) {
char *cn = canonicalize_path(devname);
if (cn) {
- try(cn);
+ print_partition_table_from_option(cn);
free(cn);
}
}
@@ -3078,12 +3081,9 @@ main(int argc, char **argv) {
listing = 1;
for (k = optind; k < argc; k++)
if (!is_ide_cdrom_or_tape(argv[k]))
- try(argv[k]);
- } else {
- /* we no longer have default device names */
- /* but we can use /proc/partitions instead */
- tryprocpt();
- }
+ print_partition_table_from_option(argv[k]);
+ } else
+ print_all_partition_table_from_option();
exit(0);
}