]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fdisk: drop one parameter from try() function
authorFrancesco Cosoleto <cosoleto@gmail.com>
Thu, 15 Dec 2011 19:02:40 +0000 (20:02 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 16 Dec 2011 13:04:01 +0000 (14:04 +0100)
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
fdisk/fdisk.c

index 1a4c823ae7e36a3fb00281c0f13a00c8d21bc770..1ecab17800fe7975648dfa03489d9dab9c262102 100644 (file)
@@ -2800,15 +2800,13 @@ gpt_warning(char *dev)
 }
 
 static void
-try(char *device, int user_specified) {
+try(char *device)
+{
        int gb;
 
        disk_device = device;
        if (setjmp(listingbuf))
                return;
-       if (!user_specified)
-               if (is_ide_cdrom_or_tape(device))
-                       return;
        gpt_warning(device);
        if ((fd = open(disk_device, type_open)) >= 0) {
                gb = get_boot(try_only);
@@ -2859,7 +2857,7 @@ tryprocpt(void) {
                if (is_whole_disk(devname)) {
                        char *cn = canonicalize_path(devname);
                        if (cn) {
-                               try(cn, 0);
+                               try(cn);
                                free(cn);
                        }
                }
@@ -3079,7 +3077,8 @@ main(int argc, char **argv) {
                        dummy(&k);
                        listing = 1;
                        for (k = optind; k < argc; k++)
-                               try(argv[k], 1);
+                               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 */