Merge pull request #2838 from DHowett/revert-2826-waitpid

Revert "Wait for the process instead of busy wait loop"
This commit is contained in:
Martin Matuška 2026-01-07 23:38:30 +01:00 committed by GitHub
commit 8d1c9b95f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -779,18 +779,16 @@ pid_t
__la_waitpid(HANDLE child, int *status, int option) __la_waitpid(HANDLE child, int *status, int option)
{ {
DWORD cs; DWORD cs;
DWORD wait_result;
(void)option; /* UNUSED */ (void)option;/* UNUSED */
wait_result = WaitForSingleObject(child, INFINITE); do {
if (wait_result != WAIT_OBJECT_0 || if (GetExitCodeProcess(child, &cs) == 0) {
GetExitCodeProcess(child, &cs) == 0) la_dosmaperr(GetLastError());
{ CloseHandle(child);
la_dosmaperr(GetLastError()); *status = 0;
CloseHandle(child); return (-1);
*status = 0; }
return (-1); } while (cs == STILL_ACTIVE);
}
CloseHandle(child); CloseHandle(child);
*status = (int)(cs & 0xff); *status = (int)(cs & 0xff);