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