]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fdisk: stop buffering welcome message
authorDavidlohr Bueso <dave@gnu.org>
Sun, 27 May 2012 19:43:56 +0000 (21:43 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 6 Jun 2012 08:11:22 +0000 (10:11 +0200)
Recently, commit 0a86755fe8af1da510d2eca43bdfcd70af098c19 directed the welcome
message output from stderr to stdout breaking regression tests.  Correct this
by flushing stdout and stop buffering the output - a trivial function is
created as well.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
fdisk/fdisk.c

index 12706c27c5ba7801104119cc56fc0e2cd2890caa..084253dbc1fe920b5926a83e149301632cc9b4f3 100644 (file)
@@ -1984,6 +1984,15 @@ unknown_command(int c) {
        printf(_("%c: unknown command\n"), c);
 }
 
+static void print_welcome(void)
+{
+       printf(_("Welcome to fdisk (%s).\n\n"
+                "Changes will remain in memory only, until you decide to write them.\n"
+                "Be careful before using the write command.\n\n"), PACKAGE_STRING);
+
+       fflush(stdout);
+}
+
 static void command_prompt(void)
 {
        int c;
@@ -2211,9 +2220,7 @@ int main(int argc, char **argv)
        else
                usage(stderr);
 
-       printf(_("Welcome to fdisk (%s).\n\n"
-               "Changes will remain in memory only, until you decide to write them.\n"
-               "Be careful before using the write command.\n\n"), PACKAGE_STRING);
+       print_welcome();
 
        gpt_warning(cxt->dev_path);
        get_boot(0);