Blob Blame Raw
--- o/run_process.c.orig	2019-02-13 15:24:31.237418459 -0700
+++ o/run_process.c	2019-02-13 15:26:03.320507581 -0700
@@ -540,10 +540,10 @@ char **argv;
   fdout = ostream->sm.sm_int;
   if (pfork() == 0)
     { /* the child --- replace standard in and out with descriptors given */
-      close(0);
-      massert(dup(fdin)>=0);
-      close(1);
-      massert(dup(fdout)>=0);
+      massert(dup2(fdin, 0)>=0);
+      massert(dup2(fdout, 1)>=0);
+      close(fdin);
+      close(fdout);
       emsg("\n***** Spawning process %s ", pname);
       if (execvp(pname, argv) == -1)
 	{