Recent change to report the errno from exec() broke things on Windows.
There when :WAIT is true it is the C code that waits, and the subsequently
returns the exit code of the process -- meaning our attempt to use 0 to
indicate exec() failure makes every successfull execution on Windows look
like an exec failure.
Oops. Use -2 instead. MORE MAGIC.
(if search 1 0)
environment-vec pty-name
(if wait 1 0))))
- (when (plusp child)
+ (unless (minusp child)
(setf proc
(apply
#'make-process
(list :%status :running))))
(push proc *active-processes*)))))
;; Report the error outside the lock.
+ #+win32
+ (when (minusp child)
+ (error "Couldn't execute ~S: ~A" progname (strerror)))
+ #-win32
(case child
- (0
- (error "Couldn't execute ~A: ~A" progname (strerror)))
+ (-2
+ (error "Couldn't execute ~S: ~A" progname (strerror)))
(-1
(error "Couldn't fork child process: ~A" (strerror))))))))))
(dolist (fd *close-in-parent*)
}
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;
}
}