summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty.c
diff options
context:
space:
mode:
authortholo <tholo@openbsd.org>1996-11-05 04:42:30 +0000
committertholo <tholo@openbsd.org>1996-11-05 04:42:30 +0000
commit5e816faca99a78c117c4d07fa1595407eaca1353 (patch)
tree5b26476a469f61b1f1672f7cf05a67b509adb93d /sys/kern/tty.c
parentEnable NFS (diff)
downloadwireguard-openbsd-5e816faca99a78c117c4d07fa1595407eaca1353.tar.xz
wireguard-openbsd-5e816faca99a78c117c4d07fa1595407eaca1353.zip
Correct error returns from tcsetpgrp() aka ioctl(, TIOCSPGRP, )
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r--sys/kern/tty.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index ee7611e1107..090c5316f09 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.13 1996/11/04 09:00:09 deraadt Exp $ */
+/* $OpenBSD: tty.c,v 1.14 1996/11/05 04:42:30 tholo Exp $ */
/* $NetBSD: tty.c,v 1.68.4.2 1996/06/06 16:04:52 thorpej Exp $ */
/*-
@@ -896,7 +896,9 @@ ttioctl(tp, cmd, data, flag, p)
if (!isctty(p, tp))
return (ENOTTY);
- else if (pgrp == NULL || pgrp->pg_session != p->p_session)
+ else if (pgrp == NULL)
+ return (EINVAL);
+ else if (pgrp->pg_session != p->p_session)
return (EPERM);
tp->t_pgrp = pgrp;
break;