aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2017-08-29 21:53:49 +0300
committerEli Zaretskii2017-08-29 21:53:49 +0300
commit02255c5fbc7e6dc0206db978994617cc72de4bb8 (patch)
treebecbe4e32051d0abe8188ef16f5d5bf110ef0861 /src
parent1454ad6f068f1d94070943b6784bc127a3119055 (diff)
downloademacs-02255c5fbc7e6dc0206db978994617cc72de4bb8.tar.gz
emacs-02255c5fbc7e6dc0206db978994617cc72de4bb8.zip
Avoid spinning waiting for git-gui.exe on Windows
* src/w32proc.c (waitpid): If GetExitCodeProcess returns STILL_ACTIVE, and we were called with WNOHANG, pretend that the process exited. (Bug#28268)
Diffstat (limited to 'src')
-rw-r--r--src/w32proc.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/w32proc.c b/src/w32proc.c
index ffd5f0d0a1a..71bd28d3c24 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -1492,12 +1492,17 @@ waitpid (pid_t pid, int *status, int options)
1492 } 1492 }
1493 if (retval == STILL_ACTIVE) 1493 if (retval == STILL_ACTIVE)
1494 { 1494 {
1495 /* Should never happen. */ 1495 /* Should never happen. But it does, with invoking git-gui.exe
1496 asynchronously. So we punt, and just report this process as
1497 exited with exit code 259, when we are called with WNOHANG
1498 from child_status_changed, because in that case we already
1499 _know_ the process has died. */
1496 DebPrint (("Wait.WaitForMultipleObjects returned an active process\n")); 1500 DebPrint (("Wait.WaitForMultipleObjects returned an active process\n"));
1497 if (pid > 0 && dont_wait) 1501 if (!(pid > 0 && dont_wait))
1498 return 0; 1502 {
1499 errno = EINVAL; 1503 errno = EINVAL;
1500 return -1; 1504 return -1;
1505 }
1501 } 1506 }
1502 1507
1503 /* Massage the exit code from the process to match the format expected 1508 /* Massage the exit code from the process to match the format expected