From: Francesco Cosoleto Date: Thu, 15 Dec 2011 19:02:41 +0000 (+0100) Subject: fdisk: rename try() and tryprocpt() functions X-Git-Tag: v2.21-rc1~121 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ea4824f1ad7940bb950d55ba50ae5bee916a888d;p=thirdparty%2Futil-linux.git fdisk: rename try() and tryprocpt() functions Signed-off-by: Francesco Cosoleto --- diff --git a/fdisk/fdisk.c b/fdisk/fdisk.c index 1ecab17800..a8a18009ac 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); }