devproc: restore psstate info string in procstopwait()

This commit is contained in:
cinap_lenrek 2019-09-08 18:53:12 +02:00
parent 971e14663a
commit 6ad06b36b2

View file

@ -1339,6 +1339,7 @@ proctext(Chan *c, Proc *p)
void
procstopwait(Proc *p, int ctl)
{
char *state;
int pid;
if(p->pdbg != nil)
@ -1354,14 +1355,17 @@ procstopwait(Proc *p, int ctl)
return;
p->pdbg = up;
qunlock(&p->debug);
state = up->psstate;
up->psstate = "Stopwait";
if(waserror()) {
up->psstate = state;
qlock(&p->debug);
p->pdbg = nil;
nexterror();
}
sleep(&up->sleep, procstopped, p);
poperror();
up->psstate = state;
qlock(&p->debug);
if(p->pid != pid)
error(Eprocdied);