summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_descrip.c3
-rw-r--r--sys/kern/kern_exec.c2
-rw-r--r--sys/kern/kern_fork.c4
-rw-r--r--sys/sys/filedesc.h2
4 files changed, 6 insertions, 5 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 4105ee3..8491d84 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -1883,9 +1883,10 @@ fdshare(struct filedesc *fdp)
* Unshare a filedesc structure, if necessary by making a copy
*/
void
-fdunshare(struct proc *p, struct thread *td)
+fdunshare(struct thread *td)
{
struct filedesc *tmp;
+ struct proc *p = td->td_proc;
if (p->p_fd->fd_refcnt == 1)
return;
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 15732fb..a129fca 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -597,7 +597,7 @@ interpret:
* For security and other reasons, the file descriptor table cannot
* be shared after an exec.
*/
- fdunshare(p, td);
+ fdunshare(td);
/*
* Malloc things before we need locks.
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 76605f4..9b04ba3 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -347,8 +347,8 @@ fork_norfproc(struct thread *td, int flags)
/*
* Unshare file descriptors (from parent).
*/
- if (flags & RFFDG)
- fdunshare(p1, td);
+ if (flags & RFFDG)
+ fdunshare(td);
fail:
if (((p1->p_flag & (P_HADTHREADS|P_SYSTEM)) == P_HADTHREADS) &&
diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h
index 0226aaa..e1d2363 100644
--- a/sys/sys/filedesc.h
+++ b/sys/sys/filedesc.h
@@ -153,7 +153,7 @@ int fdcheckstd(struct thread *td);
void fdclose(struct filedesc *fdp, struct file *fp, int idx, struct thread *td);
void fdcloseexec(struct thread *td);
struct filedesc *fdcopy(struct filedesc *fdp);
-void fdunshare(struct proc *p, struct thread *td);
+void fdunshare(struct thread *td);
void fdescfree(struct thread *td);
struct filedesc *fdinit(struct filedesc *fdp);
struct filedesc *fdshare(struct filedesc *fdp);
OpenPOWER on IntegriCloud