register struct session *sp = p->p_session;
if (sp->s_ttyvp) {
+ struct vnode *ttyvp;
+
/*
* Controlling process.
* Signal foreground pgrp,
if (sp->s_ttyvp)
VOP_REVOKE(sp->s_ttyvp, REVOKEALL);
}
- if (sp->s_ttyvp)
- vrele(sp->s_ttyvp);
+ ttyvp = sp->s_ttyvp;
sp->s_ttyvp = NULL;
+ if (ttyvp)
+ vrele(ttyvp);
/*
* s_ttyp is not zero'd; we use this to indicate
* that the session once had a controlling terminal.
* release trace file
*/
p->p_traceflag = 0; /* don't trace the vrele() */
- if (p->p_tracep)
- vrele(p->p_tracep);
+ if (p->p_tracep) {
+ struct vnode *tvp = p->p_tracep;
+ p->p_tracep = NULL;
+ vrele(tvp);
+ }
#endif
register int nfound;
register struct proc *p, *t;
int status, error;
+ struct vnode *tvp;
retry:
if (uap->pid == 0)
/*
* Release reference to text vnode
*/
- if (p->p_textvp)
- vrele(p->p_textvp);
+ tvp = p->p_textvp;
+ p->p_textvp = NULL;
+ if (tvp)
+ vrele(tvp);
/*
* Finally finished with old proc entry.
register struct session *sp = p->p_session;
if (sp->s_ttyvp) {
+ struct vnode *ttyvp;
+
/*
* Controlling process.
* Signal foreground pgrp,
if (sp->s_ttyvp)
VOP_REVOKE(sp->s_ttyvp, REVOKEALL);
}
- if (sp->s_ttyvp)
- vrele(sp->s_ttyvp);
+ ttyvp = sp->s_ttyvp;
sp->s_ttyvp = NULL;
+ if (ttyvp)
+ vrele(ttyvp);
/*
* s_ttyp is not zero'd; we use this to indicate
* that the session once had a controlling terminal.
* release trace file
*/
p->p_traceflag = 0; /* don't trace the vrele() */
- if (p->p_tracep)
- vrele(p->p_tracep);
+ if (p->p_tracep) {
+ struct vnode *tvp = p->p_tracep;
+ p->p_tracep = NULL;
+ vrele(tvp);
+ }
#endif
q = p->p_children.lh_first;