summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2013-10-18 13:52:10 +0200
committerKarel Zak <kzak@redhat.com>2013-10-23 10:46:10 +0200
commit2d8988bd262c1f0cb32590299c5554d306b5a0e1 (patch)
tree36c527d82b984033a543a3f68d1896284e8020f4
parentf362d863c477c80c8c791c1f3547953344563c2f (diff)
downloadutil-linux-2d8988bd262c1f0cb32590299c5554d306b5a0e1.tar.gz
fdisk: reorder intro warnings
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--fdisks/fdisk.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fdisks/fdisk.c b/fdisks/fdisk.c
index 1b96424c..ca49606a 100644
--- a/fdisks/fdisk.c
+++ b/fdisks/fdisk.c
@@ -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);
}