]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
agetty: Remove superfluous fflush()
authorStanislav Brabec <sbrabec@suse.cz>
Thu, 20 Jun 2019 20:16:42 +0000 (22:16 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 21 Jun 2019 12:38:32 +0000 (14:38 +0200)
eval_issue_file() contains fflush(stdout). It comes from an old code that
used fputs() to write to the console.

In the new code, we write to a temporary memstream, and
fclose(ie->output) fully replaces possible fflush(ie->output) in this
implementation.

The new print_issue_file() does not need it as well, as it uses
unbuffered write_all().

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
term-utils/agetty.c

index 43dbd6deadb64d07f380bf0bc43a118a90aebd7d..96bf41b36764dd5a511ffa690c78dfaa5a9808d3 100644 (file)
@@ -1903,8 +1903,6 @@ static void eval_issue_file(struct issue *ie,
                        f = NULL;
                } while (dirname);
 
-               fflush(stdout);
-
                if ((op->flags & F_VCONSOLE) == 0)
                        ie->do_tcrestore = 1;
        }