aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2013-02-13 19:00:26 +0200
committerEli Zaretskii2013-02-13 19:00:26 +0200
commit6e432f0cda1daa7bcee1fb5872dcfa130abe5018 (patch)
tree3e966d72dd5fd5419e41e1e4c04bb23bab72a051 /src
parenta1d23eb50565fe149ef2daf4c8404029a9ecaa74 (diff)
downloademacs-6e432f0cda1daa7bcee1fb5872dcfa130abe5018.tar.gz
emacs-6e432f0cda1daa7bcee1fb5872dcfa130abe5018.zip
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')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/w32.c21
2 files changed, 25 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 62d33e15ece..358f25b40f9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12013-02-13 Eli Zaretskii <eliz@gnu.org>
2
3 * w32.c (sys_pipe): When failing due to file descriptors above
4 MAXDESC, set errno to EMFILE.
5 (_sys_read_ahead): Update cp->status when failing to read serial
6 communications input, so that the status doesn't stay at
7 STATUS_READ_IN_PROGRESS. (Bug#13546)
8
12013-02-13 Glenn Morris <rgm@gnu.org> 92013-02-13 Glenn Morris <rgm@gnu.org>
2 10
3 * keyboard.c (input-decode-map, key-translation-map): Doc fixes. 11 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
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)
6209 { 6209 {
6210 _close (phandles[0]); 6210 _close (phandles[0]);
6211 _close (phandles[1]); 6211 _close (phandles[1]);
6212 errno = EMFILE;
6212 rc = -1; 6213 rc = -1;
6213 } 6214 }
6214 else 6215 else
@@ -6281,19 +6282,31 @@ _sys_read_ahead (int fd)
6281 6282
6282 /* Configure timeouts for blocking read. */ 6283 /* Configure timeouts for blocking read. */
6283 if (!GetCommTimeouts (hnd, &ct)) 6284 if (!GetCommTimeouts (hnd, &ct))
6284 return STATUS_READ_ERROR; 6285 {
6286 cp->status = STATUS_READ_ERROR;
6287 return STATUS_READ_ERROR;
6288 }
6285 ct.ReadIntervalTimeout = 0; 6289 ct.ReadIntervalTimeout = 0;
6286 ct.ReadTotalTimeoutMultiplier = 0; 6290 ct.ReadTotalTimeoutMultiplier = 0;
6287 ct.ReadTotalTimeoutConstant = 0; 6291 ct.ReadTotalTimeoutConstant = 0;
6288 if (!SetCommTimeouts (hnd, &ct)) 6292 if (!SetCommTimeouts (hnd, &ct))
6289 return STATUS_READ_ERROR; 6293 {
6294 cp->status = STATUS_READ_ERROR;
6295 return STATUS_READ_ERROR;
6296 }
6290 6297
6291 if (!ReadFile (hnd, &cp->chr, sizeof (char), (DWORD*) &rc, ovl)) 6298 if (!ReadFile (hnd, &cp->chr, sizeof (char), (DWORD*) &rc, ovl))
6292 { 6299 {
6293 if (GetLastError () != ERROR_IO_PENDING) 6300 if (GetLastError () != ERROR_IO_PENDING)
6294 return STATUS_READ_ERROR; 6301 {
6302 cp->status = STATUS_READ_ERROR;
6303 return STATUS_READ_ERROR;
6304 }
6295 if (!GetOverlappedResult (hnd, ovl, (DWORD*) &rc, TRUE)) 6305 if (!GetOverlappedResult (hnd, ovl, (DWORD*) &rc, TRUE))
6296 return STATUS_READ_ERROR; 6306 {
6307 cp->status = STATUS_READ_ERROR;
6308 return STATUS_READ_ERROR;
6309 }
6297 } 6310 }
6298 } 6311 }
6299 else if (fd_info[fd].flags & FILE_SOCKET) 6312 else if (fd_info[fd].flags & FILE_SOCKET)