]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fdisk: reorder intro warnings
authorKarel Zak <kzak@redhat.com>
Fri, 18 Oct 2013 11:52:10 +0000 (13:52 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 23 Oct 2013 08:46:10 +0000 (10:46 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
fdisks/fdisk.c

index 1b96424ccfdb0656e09c294538e177d93810ab96..ca49606a5d03aa739a8da21001be0ffb7858d019 100644 (file)
@@ -531,19 +531,20 @@ int main(int argc, char **argv)
                if (argc-optind != 1)
                        usage(stderr);
 
-               if (fdisk_context_assign_device(cxt, argv[optind], 0) != 0)
-                       err(EXIT_FAILURE, _("cannot open %s"), argv[optind]);
-
                /* Here starts interactive mode, use fdisk_{warn,info,..} functions */
                color_enable(UL_COLOR_GREEN);
                fdisk_info(cxt, _("Welcome to fdisk (%s)."), PACKAGE_STRING);
                color_disable();
                fdisk_info(cxt, _("Changes will remain in memory only, until you decide to write them.\n"
                                  "Be careful before using the write command.\n"));
+
+               if (fdisk_context_assign_device(cxt, argv[optind], 0) != 0)
+                       err(EXIT_FAILURE, _("cannot open %s"), argv[optind]);
+
                fflush(stdout);
 
                if (!fdisk_dev_has_disklabel(cxt)) {
-                       fdisk_warnx(cxt, _("Device does not contain a recognized partition table."));
+                       fdisk_info(cxt, _("Device does not contain a recognized partition table."));
                        fdisk_create_disklabel(cxt, NULL);
                }