Catch up with i386 change I forgot to commit.

This commit is contained in:
Julian Elischer 2002-02-19 03:23:28 +00:00
parent 9b83bb3356
commit 5b8c0a2993

View File

@ -176,9 +176,8 @@ trap(struct trapframe *tf)
sticks = td->td_kse->ke_sticks; sticks = td->td_kse->ke_sticks;
td->td_frame = tf; td->td_frame = tf;
KASSERT(td->td_ucred == NULL, ("already have a ucred")); KASSERT(td->td_ucred == NULL, ("already have a ucred"));
PROC_LOCK(p); if (td->td_ucred != p->p_ucred)
td->td_ucred = crhold(p->p_ucred); cred_update_thread(td);
PROC_UNLOCK(p);
} else { } else {
sticks = 0; sticks = 0;
if ((type & ~T_KERNEL) != T_BREAKPOINT) if ((type & ~T_KERNEL) != T_BREAKPOINT)
@ -380,10 +379,12 @@ trapsig:
user: user:
userret(td, tf, sticks); userret(td, tf, sticks);
mtx_assert(&Giant, MA_NOTOWNED); mtx_assert(&Giant, MA_NOTOWNED);
#ifdef INVARIANTS
mtx_lock(&Giant); mtx_lock(&Giant);
crfree(td->td_ucred); crfree(td->td_ucred);
mtx_unlock(&Giant); mtx_unlock(&Giant);
td->td_ucred = NULL; td->td_ucred = NULL;
#endif
out: out:
CTR1(KTR_TRAP, "trap: td=%p return", td); CTR1(KTR_TRAP, "trap: td=%p return", td);
return; return;
@ -540,9 +541,8 @@ syscall(struct trapframe *tf)
sticks = td->td_kse->ke_sticks; sticks = td->td_kse->ke_sticks;
td->td_frame = tf; td->td_frame = tf;
KASSERT(td->td_ucred == NULL, ("already have a ucred")); KASSERT(td->td_ucred == NULL, ("already have a ucred"));
PROC_LOCK(p); if (td->td_ucred != p->p_ucred)
td->td_ucred = crhold(p->p_ucred); cred_update_thread(td);
PROC_UNLOCK(p);
code = tf->tf_global[1]; code = tf->tf_global[1];
/* /*
@ -677,10 +677,12 @@ bad:
*/ */
STOPEVENT(p, S_SCX, code); STOPEVENT(p, S_SCX, code);
#ifdef INVARIANTS
mtx_lock(&Giant); mtx_lock(&Giant);
crfree(td->td_ucred); crfree(td->td_ucred);
mtx_unlock(&Giant); mtx_unlock(&Giant);
td->td_ucred = NULL; td->td_ucred = NULL;
#endif
#ifdef WITNESS #ifdef WITNESS
if (witness_list(td)) { if (witness_list(td)) {
panic("system call %s returning with mutex(s) held\n", panic("system call %s returning with mutex(s) held\n",