]> gitweb.factorcode.org Git - factor.git/commitdiff
unix: don't hack _exit to have a terminating effect; just use FUNCTION:
authorJoe Groff <arcata@gmail.com>
Thu, 15 Apr 2010 05:04:04 +0000 (22:04 -0700)
committerJoe Groff <arcata@gmail.com>
Thu, 15 Apr 2010 05:04:04 +0000 (22:04 -0700)
basis/io/launcher/unix/unix.factor
basis/unix/unix.factor

index aaaccd4719e1d9b92a32324763a33da2459accdc..87af808df2470331594171b0b25ca8b5d731cf7c 100644 (file)
@@ -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 ;
 
index e747e4843393518605288bfe0342ffb92644f886..dbbfbcce6e2ba5488fa5c69d292752f350f9a74c 100644 (file)
@@ -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 ;