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.
This commit is contained in:
Alex Shinn 2012-06-19 23:09:29 -07:00
parent 37b796e0f0
commit 05d416e17f
2 changed files with 11 additions and 1 deletions

View file

@ -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)

View file

@ -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.