{
_close (phandles[0]);
_close (phandles[1]);
+ /* Since we close the handles, set them to -1, so as to
+ avoid an assertion violation if the caller then tries to
+ close the handle again (emacs_close will abort otherwise
+ if errno is EBADF). */
+ phandles[0] = phandles[1] = -1;
errno = EMFILE;
rc = -1;
}
(ert-deftest process-tests/fd-setsize-no-crash ()
"Check that Emacs doesn't crash when trying to use more than
FD_SETSIZE file descriptors (Bug#24325)."
- (skip-unless (not (eq system-type 'windows-nt)))
(with-timeout (60)
(let ((sleep (executable-find "sleep"))
;; FD_SETSIZE is typically 1024 on Unix-like systems.
- (fd-setsize 1024)
+ ;; On MS-Windows we artificially limit FD_SETSIZE to 64,
+ ;; see the commentary in w32proc.c.
+ (fd-setsize (if (eq system-type 'windows-nt) 64 1024))
;; `make-process' allocates at least four file descriptors per process
;; when using the pipe communication method. However, it closes two of
;; them in the parent process, so we end up with only two new