diff options
Diffstat (limited to 'src/cmd/rc')
-rw-r--r-- | src/cmd/rc/plan9ish.c | 8 | ||||
-rw-r--r-- | src/cmd/rc/rc.h | 1 | ||||
-rw-r--r-- | src/cmd/rc/simple.c | 3 |
3 files changed, 11 insertions, 1 deletions
diff --git a/src/cmd/rc/plan9ish.c b/src/cmd/rc/plan9ish.c index 30fa896a..2b9011cc 100644 --- a/src/cmd/rc/plan9ish.c +++ b/src/cmd/rc/plan9ish.c @@ -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) diff --git a/src/cmd/rc/rc.h b/src/cmd/rc/rc.h index 7df5fea0..9a739272 100644 --- a/src/cmd/rc/rc.h +++ b/src/cmd/rc/rc.h @@ -137,3 +137,4 @@ int ndot; char *getstatus(void); int lastc; int lastword; +int kidpid; diff --git a/src/cmd/rc/simple.c b/src/cmd/rc/simple.c index c85c9098..85b20c37 100644 --- a/src/cmd/rc/simple.c +++ b/src/cmd/rc/simple.c @@ -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; } } } |