summaryrefslogtreecommitdiffstats
path: root/usr.bin/script/script.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/script/script.c')
-rw-r--r--usr.bin/script/script.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c
index ea5a1f6..cd577f7 100644
--- a/usr.bin/script/script.c
+++ b/usr.bin/script/script.c
@@ -163,12 +163,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;
}
OpenPOWER on IntegriCloud