0
0
mirror of https://github.com/libarchive/libarchive.git synced 2026-01-18 17:11:25 +01:00

Revert "Wait for the process instead of busy wait loop"

This commit is contained in:
Dustin L. Howett
2026-01-07 13:42:41 -08:00
committed by GitHub
parent 3cd503b75a
commit dea03d6e00

View File

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