1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-11 14:01:43 -08:00

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)
This commit is contained in:
Eli Zaretskii 2017-08-29 21:53:49 +03:00
parent 1454ad6f06
commit 02255c5fbc

View file

@ -1492,12 +1492,17 @@ waitpid (pid_t pid, int *status, int options)
}
if (retval == STILL_ACTIVE)
{
/* Should never happen. */
/* Should never happen. But it does, with invoking git-gui.exe
asynchronously. So we punt, and just report this process as
exited with exit code 259, when we are called with WNOHANG
from child_status_changed, because in that case we already
_know_ the process has died. */
DebPrint (("Wait.WaitForMultipleObjects returned an active process\n"));
if (pid > 0 && dont_wait)
return 0;
errno = EINVAL;
return -1;
if (!(pid > 0 && dont_wait))
{
errno = EINVAL;
return -1;
}
}
/* Massage the exit code from the process to match the format expected