MFC r268001:

Make fdunshare accept only td parameter.

Proc had to match the thread anyway and 2 parameters were inconsistent
with the rest.
This commit is contained in:
mjg 2014-07-06 23:23:01 +00:00
parent 63523f9ee1
commit 302b3764d6
4 changed files with 6 additions and 5 deletions

View File

@ -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;

View File

@ -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.

View File

@ -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) &&

View File

@ -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);