summaryrefslogtreecommitdiff
path: root/src/w32.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2013-02-13 19:00:26 +0200
committerEli Zaretskii <eliz@gnu.org>2013-02-13 19:00:26 +0200
commit6e432f0cda1daa7bcee1fb5872dcfa130abe5018 (patch)
tree3e966d72dd5fd5419e41e1e4c04bb23bab72a051 /src/w32.c
parenta1d23eb50565fe149ef2daf4c8404029a9ecaa74 (diff)
downloademacs-6e432f0cda1daa7bcee1fb5872dcfa130abe5018.tar.gz
Cleanup related to bug #13546 with subprocesses on MS-Windows.
src/w32.c (sys_pipe): When failing due to file descriptors above MAXDESC, set errno to EMFILE. (_sys_read_ahead): Update cp->status when failing to read serial communications input, so that the status doesn't stay at STATUS_READ_IN_PROGRESS.
Diffstat (limited to 'src/w32.c')
-rw-r--r--src/w32.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/w32.c b/src/w32.c
index 802403168f0..214fb7fdfae 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -6209,6 +6209,7 @@ sys_pipe (int * phandles)
{
_close (phandles[0]);
_close (phandles[1]);
+ errno = EMFILE;
rc = -1;
}
else
@@ -6281,19 +6282,31 @@ _sys_read_ahead (int fd)
/* Configure timeouts for blocking read. */
if (!GetCommTimeouts (hnd, &ct))
- return STATUS_READ_ERROR;
+ {
+ cp->status = STATUS_READ_ERROR;
+ return STATUS_READ_ERROR;
+ }
ct.ReadIntervalTimeout = 0;
ct.ReadTotalTimeoutMultiplier = 0;
ct.ReadTotalTimeoutConstant = 0;
if (!SetCommTimeouts (hnd, &ct))
- return STATUS_READ_ERROR;
+ {
+ cp->status = STATUS_READ_ERROR;
+ return STATUS_READ_ERROR;
+ }
if (!ReadFile (hnd, &cp->chr, sizeof (char), (DWORD*) &rc, ovl))
{
if (GetLastError () != ERROR_IO_PENDING)
- return STATUS_READ_ERROR;
+ {
+ cp->status = STATUS_READ_ERROR;
+ return STATUS_READ_ERROR;
+ }
if (!GetOverlappedResult (hnd, ovl, (DWORD*) &rc, TRUE))
- return STATUS_READ_ERROR;
+ {
+ cp->status = STATUS_READ_ERROR;
+ return STATUS_READ_ERROR;
+ }
}
}
else if (fd_info[fd].flags & FILE_SOCKET)