diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2022-01-03 18:41:48 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2022-01-03 18:41:48 +0000 |
commit | 189731aad01e09db1807c78af421c615ed3a3242 (patch) | |
tree | 4cec623654b4e4e9da03bb00f36ea49755c8ca98 /sys/src/cmd/rc/trap.c | |
parent | c51a5cfa06dd982da839c4cfcba1610259d27e38 (diff) |
rc: make it portable (for UNIX)
Fixup remaining Plan9 dependencies (chartorune()).
Add Makefile for UNIX-like systems (tested with Linux and APE).
Make error printing consistent, use Errstr() explicitely.
Get rid of NSTATUS buffer limit, just malloc it.
Diffstat (limited to 'sys/src/cmd/rc/trap.c')
-rw-r--r-- | sys/src/cmd/rc/trap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/src/cmd/rc/trap.c b/sys/src/cmd/rc/trap.c index 59f06d25b..8ee8b2441 100644 --- a/sys/src/cmd/rc/trap.c +++ b/sys/src/cmd/rc/trap.c @@ -11,10 +11,10 @@ dotrap(void) var *trapreq; word *starval; starval = vlook("*")->val; - while(ntrap) for(i = 0;i!=NSIG;i++) while(trap[i]){ + while(ntrap) for(i = 0;i<NSIG;i++) while(trap[i]){ --trap[i]; --ntrap; - if(getpid()!=mypid) Exit(getstatus()); + if(getpid()!=mypid) Exit(); trapreq = vlook(Signame[i]); if(trapreq->fn) startfunc(trapreq, copywords(starval, (word*)0), (var*)0, (redir*)0); @@ -27,6 +27,6 @@ dotrap(void) */ while(!runq->iflag) Xreturn(); } - else Exit(getstatus()); + else Exit(); } } |