]> gitweb.factorcode.org Git - factor.git/commitdiff
unix.process: use if-zero instead of re-inventing it
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 15 Apr 2010 05:45:30 +0000 (22:45 -0700)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 15 Apr 2010 05:45:30 +0000 (22:45 -0700)
basis/unix/process/process.factor

index 4b33c37d078411aa80fa21de1266260a6a398688..1e9129af58aefc224671fba0994f5ff33aaa8acf 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