From ba2fa96eebd7b65590ad53c2f28863c55aa569a7 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Wed, 14 Apr 2010 22:04:04 -0700 Subject: [PATCH] unix: don't hack _exit to have a terminating effect; just use FUNCTION: --- basis/io/launcher/unix/unix.factor | 13 +++++++------ basis/unix/unix.factor | 4 +--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/basis/io/launcher/unix/unix.factor b/basis/io/launcher/unix/unix.factor index aaaccd4719..87af808df2 100644 --- a/basis/io/launcher/unix/unix.factor +++ b/basis/io/launcher/unix/unix.factor @@ -68,12 +68,13 @@ IN: io.launcher.unix ] when ; : spawn-process ( process -- * ) - [ setup-priority ] [ 250 _exit ] recover - [ setup-redirection ] [ 251 _exit ] recover - [ current-directory get absolute-path cd ] [ 252 _exit ] recover - [ setup-environment ] [ 253 _exit ] recover - [ get-arguments exec-args-with-path ] [ 254 _exit ] recover - 255 _exit ; + [ setup-priority ] [ 2drop 250 _exit ] recover + [ setup-redirection ] [ 2drop 251 _exit ] recover + [ current-directory get absolute-path cd ] [ 2drop 252 _exit ] recover + [ setup-environment ] [ 2drop 253 _exit ] recover + [ get-arguments exec-args-with-path ] [ 2drop 254 _exit ] recover + 255 _exit + f throw ; M: unix current-process-handle ( -- handle ) getpid ; diff --git a/basis/unix/unix.factor b/basis/unix/unix.factor index e747e48433..dbbfbcce6e 100644 --- a/basis/unix/unix.factor +++ b/basis/unix/unix.factor @@ -50,9 +50,7 @@ HOOK: open-file os ( path flags mode -- fd ) : close-file ( fd -- ) [ close ] unix-system-call drop ; -: _exit ( status -- * ) - #! We throw to give this a terminating stack effect. - int f "_exit" { int } alien-invoke "Exit failed" throw ; +FUNCTION: int _exit ( int status ) ; M: unix open-file [ open ] unix-system-call ; -- 2.34.1