shithub: riscv

Download patch

ref: 6ad06b36b2a61ce20cb6a6e4c5fd15ec8ac142f8
parent: 971e14663aa9da3d8ebec3c6a066096b2a5c0236
author: cinap_lenrek <[email protected]>
date: Sun Sep 8 14:53:12 EDT 2019

devproc: restore psstate info string in procstopwait()

--- a/sys/src/9/port/devproc.c
+++ b/sys/src/9/port/devproc.c
@@ -1339,6 +1339,7 @@
 void
 procstopwait(Proc *p, int ctl)
 {
+	char *state;
 	int pid;
 
 	if(p->pdbg != nil)
@@ -1354,8 +1355,10 @@
 		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();
@@ -1362,6 +1365,7 @@
 	}
 	sleep(&up->sleep, procstopped, p);
 	poperror();
+	up->psstate = state;
 	qlock(&p->debug);
 	if(p->pid != pid)
 		error(Eprocdied);