mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
handle interrupts and backgrounded processes a little better.
This commit is contained in:
parent
25e0e4f334
commit
69ab5d3d49
3 changed files with 11 additions and 1 deletions
|
@ -386,7 +386,13 @@ notifyf(void *unused0, char *s)
|
|||
int i;
|
||||
for(i=0;syssigname[i];i++)
|
||||
if(strncmp(s, syssigname[i], strlen(syssigname[i]))==0){
|
||||
if(strncmp(s, "sys: ", 5)!=0) interrupted=1;
|
||||
if(strncmp(s, "sys: ", 5)!=0){
|
||||
if(kidpid && !interrupted){
|
||||
interrupted=1;
|
||||
postnote(PNGROUP, kidpid, s);
|
||||
}
|
||||
interrupted = 1;
|
||||
}
|
||||
goto Out;
|
||||
}
|
||||
if(strcmp(s, "sys: child") != 0)
|
||||
|
|
|
@ -137,3 +137,4 @@ int ndot;
|
|||
char *getstatus(void);
|
||||
int lastc;
|
||||
int lastword;
|
||||
int kidpid;
|
||||
|
|
|
@ -63,6 +63,7 @@ void Xsimple(void){
|
|||
Xerror("try again");
|
||||
return;
|
||||
case 0:
|
||||
rfork(RFNOTEG);
|
||||
pushword("exec");
|
||||
execexec();
|
||||
strcpy(buf, "can't exec: ");
|
||||
|
@ -70,10 +71,12 @@ void Xsimple(void){
|
|||
errstr(buf+n, ERRMAX-n);
|
||||
Exit(buf);
|
||||
default:
|
||||
kidpid = pid;
|
||||
poplist();
|
||||
/* interrupts don't get us out */
|
||||
while(Waitfor(pid, 1) < 0)
|
||||
;
|
||||
kidpid = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue