fixed startProcess
authorClaus Gittinger <cg@exept.de>
Mon, 04 Dec 1995 12:05:18 +0100
changeset 674 fba47329ac9d
parent 673 2c3a4a536cd1
child 675 f3461db7a0ee
fixed startProcess
Unix.st
--- a/Unix.st	Mon Dec 04 11:51:47 1995 +0100
+++ b/Unix.st	Mon Dec 04 12:05:18 1995 +0100
@@ -273,7 +273,7 @@
 #   define      __execve        execve
 #   define      __wait          wait
 #   define      __waitpid       waitpid
-#   if defined(ultrix) || defined(hpux) || defined(HAS_VFORK)
+#   if defined(HAS_VFORK)
 #    define     FORK            vfork
 #   else
 #    define     FORK            fork
@@ -1797,7 +1797,9 @@
 	    for (i=0; i < nargs; i++) {
 		arg = _ArrayInstPtr(argArray)->a_element[i];
 		if (__isString(arg)) {
-		    argv[i] = (char *) _stringVal(arg);
+		    argv[i] = (char *) __stringVal(arg);
+		} else {
+		    argv[i] = "";
 		}
 	    }
 	    argv[i] = NULL;
@@ -1901,7 +1903,10 @@
      id := self fork.
      id == 0 ifTrue:[
 	"I am the child"
-	self exec:'/bin/sh' withArguments:#('sh' '-c' aCommandString).
+	self exec:'/bin/sh' withArguments:(Array with:'sh' 
+						 with:'-c' 
+						 with:aCommandString).
+	self exit:1.
 	"not reached"
      ].
      ^ id
@@ -1909,7 +1914,7 @@
     "
      |pid|
 
-     pid := OperatingSystem startProcess:'sleep 2; echo hello; sleep 2; echo world'.
+     pid := OperatingSystem startProcess:'sleep 2; echo 1; sleep 2; echo 2'.
      (Delay forSeconds:3) wait.
      OperatingSystem killProcess:pid.
     "
@@ -5240,6 +5245,6 @@
 !OperatingSystem class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Attic/Unix.st,v 1.80 1995-12-04 10:20:42 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Attic/Unix.st,v 1.81 1995-12-04 11:05:18 cg Exp $'
 ! !
 OperatingSystem initialize!