From b3c62bf1193298c13593930eb5f13cc55c507c1b Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Thu, 7 Apr 1994 22:33:59 +0000 Subject: Formerly mgt.c.~5~ --- proc/mgt.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'proc/mgt.c') diff --git a/proc/mgt.c b/proc/mgt.c index 067f4ea1..9b9acd8b 100644 --- a/proc/mgt.c +++ b/proc/mgt.c @@ -185,7 +185,7 @@ S_proc_child (struct proc *parentp, /* Implement proc_reassign as described in . */ error_t S_proc_reassign (struct proc *p, - task_t newt) + task_t newt) { struct proc *stubp = task_find (newt); mach_port_t foo; @@ -193,6 +193,9 @@ S_proc_reassign (struct proc *p, if (!stubp) return ESRCH; + if (stubp == p) + return EINVAL; + remove_proc_from_hash (p); task_terminate (p->p_task); @@ -324,9 +327,9 @@ S_proc_handle_exceptions (struct proc *p, return 0; } -/* Called on provided exception ports. Do the thread_set_state - requested by proc_handle_exceptions and then send an - exception_raise message as requested. */ +/* Called on exception ports provided to proc_handle_exceptions. Do + the thread_set_state requested by proc_handle_exceptions and then + send an exception_raise message as requested. */ error_t S_proc_exception_raise (mach_port_t excport, mach_port_t reply, @@ -341,8 +344,8 @@ S_proc_exception_raise (mach_port_t excport, if (!e) return EOPNOTSUPP; if (e->replyport != MACH_PORT_NULL) - return EBUSY; - thread_set_state (thread, e->flavor, e->thread_state, e->statecnt); + return EBUSY; /* This is wrong, but too much trouble to fix now */ + thread_set_state (thread, e->flavor, e->thread_state, e->statecnt); proc_exception_raise (e->forwardport, e->excport, MACH_MSG_TYPE_MAKE_SEND_ONCE, thread, task, exception, code, subcode); @@ -352,8 +355,8 @@ S_proc_exception_raise (mach_port_t excport, } /* Called by proc_handle_exception clients after they have received - the exception_raise we send in S_exception_raise. Reply to the - agent that generated the exception raise. */ + the exception_raise we send in S_proc_exception_raise. Reply to + the agent that generated the exception raise. */ error_t S_proc_exception_raise_reply (mach_port_t excport, int replycode) -- cgit v1.2.3