X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fruntime%2Frun-program.c;h=ef9c51cb0f57d2e77d434b6790bcffd25c700602;hb=37d3828773e2f847bb1ed7522b0af4fb8e736fc8;hp=4e6f829aa057cdd5641bc86223ac1880816d607d;hpb=7e0235c6f230d9e07a710a33479697f174f393fb;p=sbcl.git diff --git a/src/runtime/run-program.c b/src/runtime/run-program.c index 4e6f829..ef9c51c 100644 --- a/src/runtime/run-program.c +++ b/src/runtime/run-program.c @@ -25,7 +25,7 @@ #include #include #include - +#include #include #include #include @@ -138,6 +138,7 @@ int spawn(char *program, char *argv[], int sin, int sout, int serr, p += n; } } + close(channel[0]); if (child_errno) { waitpid(pid, NULL, 0); /* Our convention to tell Lisp that it was the exec that @@ -192,7 +193,9 @@ int spawn(char *program, char *argv[], int sin, int sout, int serr, if (fd != channel[1]) close(fd); #endif - environ = envp; + if (envp) { + environ = envp; + } /* Exec the program. */ if (search) execvp(program, argv); @@ -290,9 +293,9 @@ HANDLE spawn ( /* Spawn process given on the command line*/ if (search) - hProcess = (HANDLE) spawnvp ( wait_mode, program, argv ); + hProcess = (HANDLE) spawnvp ( wait_mode, program, (char* const* )argv ); else - hProcess = (HANDLE) spawnv ( wait_mode, program, argv ); + hProcess = (HANDLE) spawnv ( wait_mode, program, (char* const* )argv ); /* Now that the process is launched, replace the original * in/out/err handles and close the backups. */