fix some of my more recent botches, and clean up slightly.
This commit is contained in:
parent
3fbd67b7d3
commit
64aaba1a4e
@ -37,7 +37,7 @@
|
|||||||
* From:
|
* From:
|
||||||
* Id: procfs_ctl.c,v 4.1 1993/12/17 10:47:45 jsp Rel
|
* Id: procfs_ctl.c,v 4.1 1993/12/17 10:47:45 jsp Rel
|
||||||
*
|
*
|
||||||
* $Id: procfs_ctl.c,v 1.5 1994/01/09 20:17:06 cgd Exp $
|
* $Id: procfs_ctl.c,v 1.6 1994/01/09 23:57:56 cgd Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -59,6 +59,7 @@
|
|||||||
*/
|
*/
|
||||||
#define TRACE_WAIT_P(curp, p) \
|
#define TRACE_WAIT_P(curp, p) \
|
||||||
((p)->p_stat == SSTOP && \
|
((p)->p_stat == SSTOP && \
|
||||||
|
((p)->p_flag & SWTED) && \
|
||||||
(p)->p_pptr == (curp) && \
|
(p)->p_pptr == (curp) && \
|
||||||
((p)->p_flag & STRC))
|
((p)->p_flag & STRC))
|
||||||
|
|
||||||
@ -121,8 +122,7 @@ procfs_control(curp, p, op)
|
|||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Go ahead and set the trace flag, and note that,
|
* Go ahead and set the trace flag.
|
||||||
* if we wanted one, we've got it.
|
|
||||||
* Save the old parent (it's reset in
|
* Save the old parent (it's reset in
|
||||||
* _DETACH, and also in kern_exit.c:wait4()
|
* _DETACH, and also in kern_exit.c:wait4()
|
||||||
* Reparent the process so that the tracing
|
* Reparent the process so that the tracing
|
||||||
@ -130,7 +130,6 @@ procfs_control(curp, p, op)
|
|||||||
* Stop the target.
|
* Stop the target.
|
||||||
*/
|
*/
|
||||||
p->p_flag |= STRC;
|
p->p_flag |= STRC;
|
||||||
p->p_flag &= ~SWTED;
|
|
||||||
if (p->p_pptr != curp) {
|
if (p->p_pptr != curp) {
|
||||||
p->p_oppid = p->p_pptr->p_pid;
|
p->p_oppid = p->p_pptr->p_pid;
|
||||||
proc_reparent(p, curp);
|
proc_reparent(p, curp);
|
||||||
@ -151,10 +150,6 @@ procfs_control(curp, p, op)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
/*
|
|
||||||
* XXX -- if the process is not stopped but SWTED is set, in
|
|
||||||
* its flags, we should try to attach to it!
|
|
||||||
*/
|
|
||||||
if (!TRACE_WAIT_P(curp, p))
|
if (!TRACE_WAIT_P(curp, p))
|
||||||
return (EBUSY);
|
return (EBUSY);
|
||||||
}
|
}
|
||||||
@ -193,6 +188,7 @@ procfs_control(curp, p, op)
|
|||||||
proc_reparent(p, pp);
|
proc_reparent(p, pp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p->p_flag &= ~SWTED; /* XXX ? */
|
||||||
p->p_oppid = 0;
|
p->p_oppid = 0;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user