--- gcl/o/run_process.c.orig 2020-01-31 11:48:18.373433926 -0700 +++ gcl/o/run_process.c 2020-01-31 11:54:22.417581265 -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) {