diff options
author | rsc <devnull@localhost> | 2006-02-12 19:40:55 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2006-02-12 19:40:55 +0000 |
commit | eadb18a3357b9b735b2f7da478854a39fb0c73c6 (patch) | |
tree | 71cac16be804ce29f022309a7d57219a21d8395a /src/lib9 | |
parent | 5cc53af92d6bfae8b930d3c9154c8ed44e1feb09 (diff) | |
download | plan9port-eadb18a3357b9b735b2f7da478854a39fb0c73c6.tar.gz plan9port-eadb18a3357b9b735b2f7da478854a39fb0c73c6.tar.bz2 plan9port-eadb18a3357b9b735b2f7da478854a39fb0c73c6.zip |
add exitcode
Diffstat (limited to 'src/lib9')
-rw-r--r-- | src/lib9/_exits.c | 6 | ||||
-rw-r--r-- | src/lib9/atexit.c | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/lib9/_exits.c b/src/lib9/_exits.c index 5e7c88ed..a17c25aa 100644 --- a/src/lib9/_exits.c +++ b/src/lib9/_exits.c @@ -4,7 +4,7 @@ void _exits(char *s) { - if(s && *s) - _exit(1); - _exit(0); + if(s == 0 || *s == 0) + _exit(0); + _exit(exitcode(s)); } diff --git a/src/lib9/atexit.c b/src/lib9/atexit.c index c5cdde1d..7fcf0f3c 100644 --- a/src/lib9/atexit.c +++ b/src/lib9/atexit.c @@ -50,5 +50,7 @@ exits(char *s) onex[i].f = 0; (*f)(); } - exit(s && *s ? 1 : 0); + if(s == 0 || *s == 0) + exit(0); + exit(exitcode(s)); } |