aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Verona2012-12-06 19:45:25 +0100
committerJoakim Verona2012-12-06 19:45:25 +0100
commit1c29ef46d1f73fd787365cd5d2aceab1d53cd494 (patch)
tree3381315ced6b3ce0f608d62637e9beba3c7fc31c
parent2ec68e9d1e05f396fea1167f9242e23db2316ace (diff)
parente86f51344b4bc58f8342b360eaf3d2b2ca0c470a (diff)
downloademacs-1c29ef46d1f73fd787365cd5d2aceab1d53cd494.tar.gz
emacs-1c29ef46d1f73fd787365cd5d2aceab1d53cd494.zip
auto upstream
-rw-r--r--src/ChangeLog6
-rw-r--r--src/w32proc.c11
2 files changed, 16 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 2fefef1275b..2a138bfcf65 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12012-12-06 Eli Zaretskii <eliz@gnu.org>
2
3 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
4 if the child process is still running. Instead, exit the wait
5 loop and return zero. (Bug#13086)
6
12012-12-06 Dmitry Antipov <dmantipov@yandex.ru> 72012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2 8
3 * frame.h (x_char_width, x_char_height): Remove prototypes. 9 * frame.h (x_char_width, x_char_height): Remove prototypes.
diff --git a/src/w32proc.c b/src/w32proc.c
index 87af8682390..0b36804b0e8 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -1220,13 +1220,22 @@ waitpid (pid_t pid, int *status, int options)
1220 { 1220 {
1221 QUIT; 1221 QUIT;
1222 active = WaitForMultipleObjects (nh, wait_hnd, FALSE, timeout_ms); 1222 active = WaitForMultipleObjects (nh, wait_hnd, FALSE, timeout_ms);
1223 } while (active == WAIT_TIMEOUT); 1223 } while (active == WAIT_TIMEOUT && !dont_wait);
1224 1224
1225 if (active == WAIT_FAILED) 1225 if (active == WAIT_FAILED)
1226 { 1226 {
1227 errno = EBADF; 1227 errno = EBADF;
1228 return -1; 1228 return -1;
1229 } 1229 }
1230 else if (active == WAIT_TIMEOUT && dont_wait)
1231 {
1232 /* PID specifies our subprocess, but it didn't exit yet, so its
1233 status is not yet available. */
1234#ifdef FULL_DEBUG
1235 DebPrint (("Wait: PID %d not reap yet\n", cp->pid));
1236#endif
1237 return 0;
1238 }
1230 else if (active >= WAIT_OBJECT_0 1239 else if (active >= WAIT_OBJECT_0
1231 && active < WAIT_OBJECT_0+MAXIMUM_WAIT_OBJECTS) 1240 && active < WAIT_OBJECT_0+MAXIMUM_WAIT_OBJECTS)
1232 { 1241 {