summaryrefslogtreecommitdiff
path: root/sys/kern/kern_descrip.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r--sys/kern/kern_descrip.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 6de08b92085..2c1fe0b0a35 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_descrip.c,v 1.121 2015/10/16 13:37:43 millert Exp $ */
+/* $OpenBSD: kern_descrip.c,v 1.122 2015/10/21 16:09:13 bluhm Exp $ */
/* $NetBSD: kern_descrip.c,v 1.42 1996/03/30 22:24:38 christos Exp $ */
/*
@@ -429,6 +429,10 @@ restart:
*retval = ((struct socket *)fp->f_data)->so_pgid;
break;
}
+ if (fp->f_type == DTYPE_PIPE) {
+ *retval = ((struct pipe *)fp->f_data)->pipe_pgid;
+ break;
+ }
error = (*fp->f_ops->fo_ioctl)
(fp, TIOCGPGRP, (caddr_t)&tmp, p);
*retval = -tmp;
@@ -443,6 +447,12 @@ restart:
so->so_sigeuid = p->p_ucred->cr_uid;
break;
}
+ if (fp->f_type == DTYPE_PIPE) {
+ struct pipe *mpipe = (struct pipe *)fp->f_data;
+
+ mpipe->pipe_pgid = (long)SCARG(uap, arg);
+ break;
+ }
if ((long)SCARG(uap, arg) <= 0) {
SCARG(uap, arg) = (void *)(-(long)SCARG(uap, arg));
} else {