public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] script: Also flush writes to timing file.
@ 2014-02-17 21:43 Jesper Dahl Nyerup
  2014-02-18 10:08 ` Sami Kerola
  2014-02-18 19:48 ` Jesper Dahl Nyerup
  0 siblings, 2 replies; 7+ messages in thread
From: Jesper Dahl Nyerup @ 2014-02-17 21:43 UTC (permalink / raw)
  To: util-linux; +Cc: nyerup

If both -f and -t are given, flush the timing fd on each write, similar
to the behavior on the script fd. This allows playback of still-running
sessions, and reduces the risk of ending up with empty timing files when
script(1) exits abnormally.

Signed-off-by: Jesper Dahl Nyerup <nyerup@one.com>
---
 term-utils/script.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/term-utils/script.c b/term-utils/script.c
index a4c2e0c..49f21b6 100644
--- a/term-utils/script.c
+++ b/term-utils/script.c
@@ -442,6 +442,8 @@ dooutput(FILE *timingfd) {
 		}
 		if (fflg)
 			fflush(fscript);
+			if (tflg)
+				fflush(timingfd);
 		if (write_all(STDOUT_FILENO, obuf, cc)) {
 			warn (_("write failed"));
 			fail();
-- 
1.8.4


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

end of thread, other threads:[~2014-02-23 19:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-17 21:43 [PATCH] script: Also flush writes to timing file Jesper Dahl Nyerup
2014-02-18 10:08 ` Sami Kerola
2014-02-18 10:21   ` Jesper Dahl Nyerup
2014-02-18 19:48 ` Jesper Dahl Nyerup
2014-02-18 19:51   ` Jesper Dahl Nyerup
2014-02-21 12:44   ` Karel Zak
2014-02-23 19:20     ` Jesper Dahl Nyerup

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox