From 05d416e17ffdc29410eb24613634b2dbb41907c7 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Tue, 19 Jun 2012 23:09:29 -0700 Subject: [PATCH] The argument to exit is optional, and is treated as 1 for any non-integer ("error" for any non-string on plan9). The idiom (exit #f) can be used to indicate an arbitrary error. --- lib/chibi/process.scm | 8 ++++++++ lib/chibi/process.stub | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/chibi/process.scm b/lib/chibi/process.scm index b4221824..4e332f82 100644 --- a/lib/chibi/process.scm +++ b/lib/chibi/process.scm @@ -1,4 +1,12 @@ +(cond-expand + (plan9 + (define (exit . o) + (%exit (if (pair? o) (if (string? (car o)) (car o) "error") "")))) + (else + (define (exit . o) + (%exit (if (pair? o) (if (integer? (car o)) (car o) 1) 0))))) + (cond-expand (bsd (define (process-command-line pid) diff --git a/lib/chibi/process.stub b/lib/chibi/process.stub index fca6db84..d37e1b84 100644 --- a/lib/chibi/process.stub +++ b/lib/chibi/process.stub @@ -117,7 +117,9 @@ ;;> Exits the current process immediately. Finalizers are not run. -(define-c void exit (int)) +(cond-expand + (plan9 (define-c void (%exit exit) (string))) + (else (define-c void (%exit exit) (int)))) ;;> Replace the current process with the given command. Finalizers ;;> are not run.