unix: don't hack _exit to have a terminating effect; just use FUNCTION:
parent
343856307e
commit
ba2fa96eeb
|
@ -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 ;
|
||||
|
||||
|
|
|
@ -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 ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue