Skip to content
Snippets Groups Projects
Commit 3aec3f5e authored by Raymond Toy's avatar Raymond Toy
Browse files

Merge branch 'issue-128-quit-exit-code' into 'master'

Fix #128: quit accepts an exit code

Closes #128

See merge request cmucl/cmucl!87
parents 88ca0184 9cf3916e
No related branches found
No related tags found
No related merge requests found
......@@ -492,14 +492,15 @@
;;; Quit gets us out, one way or another.
(defun quit (&optional recklessly-p)
"Terminates the current Lisp. Things are cleaned up unless Recklessly-P is
non-Nil."
(defun quit (&optional recklessly-p (code 0))
"Terminates the current Lisp. Things are cleaned up unless
Recklessly-P is non-Nil. On quitting, Lisp sets the return code to
Code, defaulting to 0."
(if recklessly-p
(unix:unix-exit 0)
(unix:unix-exit code)
(progn
(mapc (lambda (fn) (ignore-errors (funcall fn))) *cleanup-functions*)
(throw '%end-of-the-world 0))))
(throw '%end-of-the-world code))))
#-mp ; Multi-processing version defined in multi-proc.lisp.
......
......@@ -51,6 +51,7 @@ public domain.
* ~~#121~~ Wrong column index in FILL-POINTER-OUTPUT-STREAM
* ~~#122~~ gcc 11 can't build cmucl
* ~~#127~~ Linux unix-getpwuid segfaults when given non-existent uid.
* ~~#128~~ `QUIT` accepts an exit code
* Other changes:
* Improvements to the PCL implementation of CLOS:
* Changes to building procedure:
......
......@@ -309,8 +309,9 @@ msgstr ""
 
#: src/code/lispinit.lisp
msgid ""
"Terminates the current Lisp. Things are cleaned up unless Recklessly-P is\n"
" non-Nil."
"Terminates the current Lisp. Things are cleaned up unless\n"
" Recklessly-P is non-Nil. On quitting, Lisp sets the return code to\n"
" Code, defaulting to 0."
msgstr ""
 
#: src/code/lispinit.lisp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment