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>
warn (_("cannot write script file"));
fail();
}
- if (fflg)
+ if (fflg) {
fflush(fscript);
+ if (tflg)
+ fflush(timingfd);
+ }
if (write_all(STDOUT_FILENO, obuf, cc)) {
warn (_("write failed"));
fail();