]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fdisk: remove user specified sector size global variable
authorDavidlohr Bueso <dave@gnu.org>
Sun, 3 Jun 2012 17:47:44 +0000 (19:47 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 6 Jun 2012 08:43:27 +0000 (10:43 +0200)
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
fdisk/fdisk.c

index 578b72d9a820c25133e30eff9662c44cad4ee4d6..d9b03d79dc26cd3f84a9aeaa9385ae6787eddb33 100644 (file)
@@ -141,7 +141,6 @@ sector_t sector_offset = 1, sectors;
 
 unsigned int   heads,
        cylinders,
-       user_set_sector_size = 0,
        units_per_sector = 1,
        display_in_cyl_units = 0;
 
@@ -2061,7 +2060,6 @@ int main(int argc, char **argv)
                            sector_size != 2048 && sector_size != 4096)
                                usage(stderr);
                        sector_offset = 2;
-                       user_set_sector_size = 1;
                        break;
                case 'C':
                        user_cylinders =  strtou32_or_err(optarg, _("invalid cylinders argument"));
@@ -2110,7 +2108,7 @@ int main(int argc, char **argv)
 
        fdisk_init_debug(0);
 
-       if (user_set_sector_size && argc-optind != 1)
+       if (sector_size && argc-optind != 1)
                printf(_("Warning: the -b (set sector size) option should"
                         " be used with one specified device\n"));
 
@@ -2146,7 +2144,7 @@ int main(int argc, char **argv)
                cxt = fdisk_new_context_from_filename(argv[optind], 0);
                if (!cxt)
                        err(EXIT_FAILURE, _("unable to open %s"), argv[optind]);
-               if (user_set_sector_size) /* passed -b option, override autodiscovery */
+               if (sector_size) /* passed -b option, override autodiscovery */
                        cxt->phy_sector_size = cxt->sector_size = sector_size;
        }
        else