mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
Merge branch 'master' of github.com:ashinn/chibi-scheme
This commit is contained in:
commit
8e9b15eda8
1 changed files with 12 additions and 2 deletions
14
main.c
14
main.c
|
@ -25,10 +25,11 @@
|
||||||
|
|
||||||
#ifdef PLAN9
|
#ifdef PLAN9
|
||||||
#define exit_failure() exits("ERROR")
|
#define exit_failure() exits("ERROR")
|
||||||
|
#define exit_success() exits(nil)
|
||||||
#else
|
#else
|
||||||
#define exit_failure() exit(70)
|
#define exit_failure() exit(70)
|
||||||
#endif
|
|
||||||
#define exit_success() exit(0)
|
#define exit_success() exit(0)
|
||||||
|
#endif
|
||||||
|
|
||||||
#if SEXP_USE_MAIN_HELP
|
#if SEXP_USE_MAIN_HELP
|
||||||
void sexp_usage(int err) {
|
void sexp_usage(int err) {
|
||||||
|
@ -682,7 +683,16 @@ int main (int argc, char **argv) {
|
||||||
sexp_scheme_init();
|
sexp_scheme_init();
|
||||||
res = run_main(argc, argv);
|
res = run_main(argc, argv);
|
||||||
if (sexp_fixnump(res)) {
|
if (sexp_fixnump(res)) {
|
||||||
return sexp_unbox_fixnum(res);
|
int code = sexp_unbox_fixnum(res);
|
||||||
|
#ifdef PLAN9
|
||||||
|
if (code == 0) {
|
||||||
|
exit_success();
|
||||||
|
} else {
|
||||||
|
exit_failure();
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
return code;
|
||||||
|
#endif
|
||||||
} else if (res == SEXP_FALSE) {
|
} else if (res == SEXP_FALSE) {
|
||||||
exit_failure();
|
exit_failure();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue