diff options
author | deraadt <deraadt@openbsd.org> | 2019-01-13 23:40:30 +0000 |
---|---|---|
committer | deraadt <deraadt@openbsd.org> | 2019-01-13 23:40:30 +0000 |
commit | dec45198c18bbe3ab9e36ed94cefd1430cda9bb9 (patch) | |
tree | 7648943f658f900a574113a3e4591a3898ec64f9 /sbin/ttyflags | |
parent | Map SHT_LLVM_ADDRSIG to string (diff) | |
download | wireguard-openbsd-dec45198c18bbe3ab9e36ed94cefd1430cda9bb9.tar.xz wireguard-openbsd-dec45198c18bbe3ab9e36ed94cefd1430cda9bb9.zip |
Skip open of "network" ttys because they permanently retain the (large)
tty buffers after that.
from miod
Diffstat (limited to 'sbin/ttyflags')
-rw-r--r-- | sbin/ttyflags/ttyflags.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sbin/ttyflags/ttyflags.c b/sbin/ttyflags/ttyflags.c index f4712d9777f..01aa3ee145f 100644 --- a/sbin/ttyflags/ttyflags.c +++ b/sbin/ttyflags/ttyflags.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ttyflags.c,v 1.13 2012/12/04 02:27:00 deraadt Exp $ */ +/* $OpenBSD: ttyflags.c,v 1.14 2019/01/13 23:40:30 deraadt Exp $ */ /* $NetBSD: ttyflags.c,v 1.8 1996/04/09 05:20:30 cgd Exp $ */ /* @@ -112,9 +112,13 @@ all(int print) int rval; rval = 0; - for (tep = getttyent(); tep != NULL; tep = getttyent()) + for (tep = getttyent(); tep != NULL; tep = getttyent()) { + /* pseudo-tty ignore TIOCSFLAGS, so don't bother */ + if (strcmp(tep->ty_type, "network") == 0) + continue; if (ttyflags(tep, print)) rval = 1; + } return (rval); } |