]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/unix/process/process.factor
Updating code to use with-out-parameters
[factor.git] / basis / unix / process / process.factor
index 4b33c37d078411aa80fa21de1266260a6a398688..a112b9829a6ab9ca52d420990772b3ffe3add138 100644 (file)
@@ -36,8 +36,7 @@ FUNCTION: int execve ( c-string path, c-string* argv, c-string* envp ) ;
     [ [ first ] [ ] bi ] dip exec-with-env ;
 
 : with-fork ( child parent -- )
-    [ [ fork-process dup zero? ] dip '[ drop @ ] ] dip
-    if ; inline
+    [ fork-process ] 2dip if-zero ; inline
 
 CONSTANT: SIGKILL 9
 CONSTANT: SIGTERM 15
@@ -96,6 +95,3 @@ CONSTANT: WNOWAIT    HEX: 1000000
 
 FUNCTION: pid_t wait ( int* status ) ;
 FUNCTION: pid_t waitpid ( pid_t wpid, int* status, int options ) ;
-
-: wait-for-pid ( pid -- status )
-    0 <int> [ 0 waitpid drop ] keep *int WEXITSTATUS ;