summaryrefslogtreecommitdiffstats
path: root/bin/stty
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2000-04-30 16:22:09 +0000
committerache <ache@FreeBSD.org>2000-04-30 16:22:09 +0000
commitaa662159af43f8cb75ca80df5e1d2d4653eafa64 (patch)
tree9bd395fce9f487d551ec8f2416670a6f046eaabb /bin/stty
parentab9576d148911cbb62bb83809ab44e7301ab63e9 (diff)
downloadFreeBSD-src-aa662159af43f8cb75ca80df5e1d2d4653eafa64.zip
FreeBSD-src-aa662159af43f8cb75ca80df5e1d2d4653eafa64.tar.gz
gfmt: set drainwait only if changed
It allows to restore tty state without a warning for non-superuser
Diffstat (limited to 'bin/stty')
-rw-r--r--bin/stty/gfmt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/stty/gfmt.c b/bin/stty/gfmt.c
index 19baf83..b408792 100644
--- a/bin/stty/gfmt.c
+++ b/bin/stty/gfmt.c
@@ -133,8 +133,10 @@ gread(i, s)
}
if (CHK("drainwait")) {
(void)sscanf(ep, "%ld", &tmp);
- i->timeout = tmp;
- i->tset = 1;
+ if (i->timeout != tmp) {
+ i->timeout = tmp;
+ i->tset = 1;
+ }
continue;
}
for (cp = cchars1; cp->name != NULL; ++cp)
OpenPOWER on IntegriCloud