aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_fork.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r--sys/kern/kern_fork.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 60bf8a7093c9..d7f737832824 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -451,10 +451,7 @@ do_fork(struct thread *td, struct fork_req *fr, struct proc *p2, struct thread *
* Shared file descriptor table, and shared
* process leaders.
*/
- fdtol = p1->p_fdtol;
- FILEDESC_XLOCK(p1->p_fd);
- fdtol->fdl_refcount++;
- FILEDESC_XUNLOCK(p1->p_fd);
+ fdtol = filedesc_to_leader_share(p1->p_fdtol, p1->p_fd);
} else {
/*
* Shared file descriptor table, and different