diff --git a/src/code/lispinit.lisp b/src/code/lispinit.lisp index 5ed7b9661c5cd08236ae4b3f87f607aa5484a117..01d7f33c228339736c1bf954ffa6af14ecdd6327 100644 --- a/src/code/lispinit.lisp +++ b/src/code/lispinit.lisp @@ -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. diff --git a/src/general-info/release-21e.md b/src/general-info/release-21e.md index 65253e8087d54b60e7ef6c280d62d4ddd2625719..2e2ade1b4188eedda0063587c973d39d80877625 100644 --- a/src/general-info/release-21e.md +++ b/src/general-info/release-21e.md @@ -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: diff --git a/src/i18n/locale/cmucl.pot b/src/i18n/locale/cmucl.pot index 617132729cafd08e195d4b1c720a1ce8732f4aa6..32fb631ae8755d2e085fd0ace190ec5133fd428d 100644 --- a/src/i18n/locale/cmucl.pot +++ b/src/i18n/locale/cmucl.pot @@ -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