--- o/run_process.c.orig 2014-10-23 15:29:00.000000000 -0600 +++ o/run_process.c 2014-10-28 12:00:00.000000000 -0600 @@ -537,10 +537,10 @@ fdout = ostream->sm.sm_int0; 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); fprintf(stderr, "\n***** Spawning process %s ", pname); if (execvp(pname, argv) == -1) {