From e1bd4097fba033c72ac86fb31fcdf1ff1415bc74 Mon Sep 17 00:00:00 2001 From: trociny Date: Mon, 20 Jan 2014 20:33:40 +0000 Subject: [PATCH] MFC r260833: Bring back r226403, the fix for bin/161526, which was (accidentally?) reverted in r238896. PR: bin/161526 Reported by: Karli.Sjoberg slu.se git-svn-id: svn://svn.freebsd.org/base/stable/10@260924 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- usr.bin/script/script.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c index 515a10eb2..4e5e31372 100644 --- a/usr.bin/script/script.c +++ b/usr.bin/script/script.c @@ -235,12 +235,15 @@ main(int argc, char *argv[]) FD_SET(master, &rfd); if (readstdin) FD_SET(STDIN_FILENO, &rfd); - if ((!readstdin && ttyflg) || flushtime > 0) { - tv.tv_sec = !readstdin && ttyflg ? 1 : - flushtime - (tvec - start); + if (!readstdin && ttyflg) { + tv.tv_sec = 1; tv.tv_usec = 0; tvp = &tv; readstdin = 1; + } else if (flushtime > 0) { + tv.tv_sec = flushtime - (tvec - start); + tv.tv_usec = 0; + tvp = &tv; } else { tvp = NULL; } -- 2.45.0