]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Revert "Wait for the process instead of busy wait loop" 2838/head
authorDustin L. Howett <dustin@howett.net>
Wed, 7 Jan 2026 21:42:41 +0000 (13:42 -0800)
committerGitHub <noreply@github.com>
Wed, 7 Jan 2026 21:42:41 +0000 (13:42 -0800)
libarchive/archive_windows.c

index 6cc36225b29556003271007224f97224085e3870..3fbea6c5b6dd4b7490ae1852fed58f446999beb8 100644 (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);