summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2020-07-22 17:39:50 +0000
committerderaadt <deraadt@openbsd.org>2020-07-22 17:39:50 +0000
commit739ba58d18dd2b3934ea31eb08521b01a571f2bb (patch)
tree66df4680f7f51586c5be7e4a2111b3efe34b74dd /sys/kern/tty.c
parentImplement IPIs. (diff)
downloadwireguard-openbsd-739ba58d18dd2b3934ea31eb08521b01a571f2bb.tar.xz
wireguard-openbsd-739ba58d18dd2b3934ea31eb08521b01a571f2bb.zip
pstat -t was showing bogus column data on ttys, in modes where
newline doesn't occur to rewind to column 0. If OPOST is inactive, simply return 0. ok millert
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r--sys/kern/tty.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index e747a4f3035..9975c349e8b 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.162 2020/07/20 18:42:30 deraadt Exp $ */
+/* $OpenBSD: tty.c,v 1.163 2020/07/22 17:39:50 deraadt Exp $ */
/* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */
/*-
@@ -2408,7 +2408,8 @@ ttystats_init(struct itty **ttystats, int *ttycp, size_t *ttystatssiz)
itp->t_outq_c_cc = tp->t_outq.c_cc;
itp->t_hiwat = tp->t_hiwat;
itp->t_lowat = tp->t_lowat;
- itp->t_column = tp->t_column;
+ if (ISSET(tp->t_oflag, OPOST))
+ itp->t_column = tp->t_column;
itp->t_state = tp->t_state;
itp->t_session = tp->t_session;
if (tp->t_pgrp)