From 4806d88677d2a333254f9fc33d4e119cc56bb002 Mon Sep 17 00:00:00 2001 From: jhb Date: Thu, 11 Oct 2001 23:38:17 +0000 Subject: Change the kernel's ucred API as follows: - crhold() returns a reference to the ucred whose refcount it bumps. - crcopy() now simply copies the credentials from one credential to another and has no return value. - a new crshared() primitive is added which returns true if a ucred's refcount is > 1 and false (0) otherwise. --- sys/kern/kern_fork.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sys/kern/kern_fork.c') diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index f5ae42c..592ff44 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -471,8 +471,7 @@ again: * We start off holding one spinlock after fork: sched_lock. */ PROC_LOCK(p1); - crhold(p1->p_ucred); - p2->p_ucred = p1->p_ucred; + p2->p_ucred = crhold(p1->p_ucred); if (p2->p_args) p2->p_args->ar_ref++; -- cgit v1.1