aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/rc/trap.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2007-03-26 12:02:41 +0000
committerrsc <devnull@localhost>2007-03-26 12:02:41 +0000
commitc8f538425f4e92e1e438b9bd25cb08e250a93d5b (patch)
treed701abbcd4973d5b6909d104eefe521de70a4e1c /src/cmd/rc/trap.c
parent79049567a0fac8707ea3f2927403445bdb2394fa (diff)
downloadplan9port-c8f538425f4e92e1e438b9bd25cb08e250a93d5b.tar.gz
plan9port-c8f538425f4e92e1e438b9bd25cb08e250a93d5b.tar.bz2
plan9port-c8f538425f4e92e1e438b9bd25cb08e250a93d5b.zip
sync with plan 9
Diffstat (limited to 'src/cmd/rc/trap.c')
-rw-r--r--src/cmd/rc/trap.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/cmd/rc/trap.c b/src/cmd/rc/trap.c
index 96ef364a..a572cac3 100644
--- a/src/cmd/rc/trap.c
+++ b/src/cmd/rc/trap.c
@@ -3,22 +3,25 @@
#include "fns.h"
#include "io.h"
extern char *Signame[];
-void dotrap(void){
- register int i;
- register struct var *trapreq;
- register struct word *starval;
- starval=vlook("*")->val;
- while(ntrap) for(i=0;i!=NSIG;i++) while(trap[i]){
+
+void
+dotrap(void)
+{
+ int i;
+ struct var *trapreq;
+ struct word *starval;
+ starval = vlook("*")->val;
+ while(ntrap) for(i = 0;i!=NSIG;i++) while(trap[i]){
--trap[i];
--ntrap;
if(getpid()!=mypid) Exit(getstatus());
- trapreq=vlook(Signame[i]);
+ trapreq = vlook(Signame[i]);
if(trapreq->fn){
start(trapreq->fn, trapreq->pc, (struct var *)0);
- runq->local=newvar(strdup("*"), runq->local);
- runq->local->val=copywords(starval, (struct word *)0);
- runq->local->changed=1;
- runq->redir=runq->startredir=0;
+ runq->local = newvar(strdup("*"), runq->local);
+ runq->local->val = copywords(starval, (struct word *)0);
+ runq->local->changed = 1;
+ runq->redir = runq->startredir = 0;
}
else if(i==SIGINT || i==SIGQUIT){
/*