diff options
Diffstat (limited to 'sys/kern/tty_pty.c')
-rw-r--r-- | sys/kern/tty_pty.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index 970cb044942..d16fb827a8c 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_pty.c,v 1.81 2018/01/02 06:38:45 guenther Exp $ */ +/* $OpenBSD: tty_pty.c,v 1.82 2018/01/08 11:52:14 mpi Exp $ */ /* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */ /* @@ -861,6 +861,20 @@ ptyioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) if (error < 0) error = ttioctl(tp, cmd, data, flag, p); if (error < 0) { + /* + * Translate TIOCSBRK/TIOCCBRK to user mode ioctls to + * let the master interpret BREAK conditions. + */ + switch (cmd) { + case TIOCSBRK: + cmd = UIOCCMD(TIOCUCNTL_SBRK); + break; + case TIOCCBRK: + cmd = UIOCCMD(TIOCUCNTL_CBRK); + break; + default: + break; + } if (pti->pt_flags & PF_UCNTL && (cmd & ~0xff) == UIOCCMD(0)) { if (cmd & 0xff) { |