summaryrefslogtreecommitdiff
path: root/src/w32.c
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2021-01-02 10:11:15 +0100
committerAndrea Corallo <akrl@sdf.org>2021-01-02 10:11:15 +0100
commit5db5064395c251a822e429e19ddecb74a974b6ef (patch)
tree2e04729a03d5fc68d0caef3a16e00349b6d413fc /src/w32.c
parent9420ea6e0840bffcb140d3677dfdabb9251c1f63 (diff)
parent0f561ee55348ff451600cc6027db5940ee14606f (diff)
downloademacs-5db5064395c251a822e429e19ddecb74a974b6ef.tar.gz
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'src/w32.c')
-rw-r--r--src/w32.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/w32.c b/src/w32.c
index 0d38eae7fea..202acb7d5fd 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -1,6 +1,6 @@
/* Utility and Unix shadow routines for GNU Emacs on the Microsoft Windows API.
-Copyright (C) 1994-1995, 2000-2020 Free Software Foundation, Inc.
+Copyright (C) 1994-1995, 2000-2021 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -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;
}