cleanup: use size_t for new_areas_index and max_new_areas
[sbcl.git] / src / runtime / run-program.c
index 7377e7f..00692b7 100644 (file)
@@ -138,9 +138,12 @@ int spawn(char *program, char *argv[], int sin, int sout, int serr,
                     p += n;
                 }
             }
+            close(channel[0]);
             if (child_errno) {
                 waitpid(pid, NULL, 0);
-                pid = 0;
+                /* Our convention to tell Lisp that it was the exec that
+                 * failed, not the fork. */
+                pid = -2;
                 errno = child_errno;
             }
         }