Util-Linux Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] agetty: Remove superfluous fflush()
@ 2019-06-20 20:16 Stanislav Brabec
  2019-06-24  7:22 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Stanislav Brabec @ 2019-06-20 20:16 UTC (permalink / raw)
  To: util-linux

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 | 2 --
 1 file changed, 2 deletions(-)

diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index 43dbd6dea..96bf41b36 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -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;
 	}
-- 
2.21.0

-- 
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                         e-mail: sbrabec@suse.com
Køi¾íkova 148/34 (Corso IIa)                    tel: +420 284 084 060
186 00 Praha 8-Karlín                          fax:  +420 284 084 001
Czech Republic                                    http://www.suse.cz/
PGP: 830B 40D5 9E05 35D8 5E27 6FA3 717C 209F A04F CD76

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] agetty: Remove superfluous fflush()
  2019-06-20 20:16 [PATCH] agetty: Remove superfluous fflush() Stanislav Brabec
@ 2019-06-24  7:22 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2019-06-24  7:22 UTC (permalink / raw)
  To: Stanislav Brabec; +Cc: util-linux

On Thu, Jun 20, 2019 at 10:16:42PM +0200, Stanislav Brabec wrote:
>  term-utils/agetty.c | 2 --
>  1 file changed, 2 deletions(-)

Applied, thanks.

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-20 20:16 [PATCH] agetty: Remove superfluous fflush() Stanislav Brabec
2019-06-24  7:22 ` Karel Zak

Util-Linux Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/util-linux/0 util-linux/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 util-linux util-linux/ https://lore.kernel.org/util-linux \
		util-linux@vger.kernel.org util-linux@archiver.kernel.org
	public-inbox-index util-linux


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.util-linux


AGPL code for this site: git clone https://public-inbox.org/ public-inbox