summaryrefslogtreecommitdiff
path: root/usr.bin/script
diff options
context:
space:
mode:
authorMikolaj Golub <trociny@FreeBSD.org>2014-01-17 21:45:25 +0000
committerMikolaj Golub <trociny@FreeBSD.org>2014-01-17 21:45:25 +0000
commit29f4384a31e5e3defd1bbf56fc5a8bcb118a499f (patch)
treed86ef850a12e33e6eb6ea8747c6ae89890d52b68 /usr.bin/script
parent3cb44b3f65bfa85b17544103dac2f193f11baae4 (diff)
downloadsrc-test2-29f4384a31e5e3defd1bbf56fc5a8bcb118a499f.tar.gz
src-test2-29f4384a31e5e3defd1bbf56fc5a8bcb118a499f.zip
Notes
Diffstat (limited to 'usr.bin/script')
-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 1396d3d1f383..72814fbe17ad 100644
--- a/usr.bin/script/script.c
+++ b/usr.bin/script/script.c
@@ -238,12 +238,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;
}