summaryrefslogtreecommitdiff
path: root/src/w32.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2020-12-29 21:30:59 +0200
committerEli Zaretskii <eliz@gnu.org>2020-12-29 21:30:59 +0200
commitbaac3562a669ef4570cc258b5e6fc6472a6c9407 (patch)
tree019abdc1f967917a3c2ee119ec3e09ff8d057d9b /src/w32.c
parent0326cddc7bb2a90924af200057b4e2ef263924c8 (diff)
downloademacs-baac3562a669ef4570cc258b5e6fc6472a6c9407.tar.gz
emacs-baac3562a669ef4570cc258b5e6fc6472a6c9407.tar.bz2
emacs-baac3562a669ef4570cc258b5e6fc6472a6c9407.zip
A better fix for process-tests on MS-Windows
* src/w32.c (pipe2): When forcibly closing pipe handles due to overflow of FD_SETSIZE, set the handles to -1, to avoid assertion violations in emacs_close. * test/src/process-tests.el (process-tests/fd-setsize-no-crash): No need to skip this test anymore.
Diffstat (limited to 'src/w32.c')
-rw-r--r--src/w32.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/w32.c b/src/w32.c
index 5ebae324c20..56c78a0d229 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -8667,6 +8667,11 @@ pipe2 (int * phandles, int pipe2_flags)
{
_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;
}