diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 2004-12-14 07:20:03 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2004-12-14 07:20:03 +0000 |
| commit | c113083c5a91f7bfa24346dd2ad71b5f4c3d0c1a (patch) | |
| tree | d5213f95c16764c73163213eb2df16556c38d979 /sys/kern/kern_exec.c | |
| parent | b96aca53dcaa2a93944c8dd702717b3e822db65b (diff) | |
Notes
Diffstat (limited to 'sys/kern/kern_exec.c')
| -rw-r--r-- | sys/kern/kern_exec.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index e21cb0068ff7..40e0f0a2dfdb 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -465,16 +465,7 @@ interpret: * For security and other reasons, the file descriptor table cannot * be shared after an exec. */ - FILEDESC_LOCK_FAST(p->p_fd); - if (p->p_fd->fd_refcnt > 1) { - struct filedesc *tmp; - - FILEDESC_UNLOCK_FAST(p->p_fd); - tmp = fdcopy(p->p_fd); - fdfree(td); - p->p_fd = tmp; - } else - FILEDESC_UNLOCK_FAST(p->p_fd); + fdunshare(p, td); /* * Malloc things before we need locks. |
