diff options
Diffstat (limited to 'winsup/utils/kill.cc')
-rw-r--r-- | winsup/utils/kill.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/winsup/utils/kill.cc b/winsup/utils/kill.cc index c5b61c616..dc654a236 100644 --- a/winsup/utils/kill.cc +++ b/winsup/utils/kill.cc @@ -133,11 +133,12 @@ forcekill (int pid, int sig, int wait) HANDLE h = OpenProcess (PROCESS_TERMINATE, FALSE, (DWORD) dwpid); if (!h) { - fprintf (stderr, "couldn't open pid %u\n", (unsigned) dwpid); - return; + fprintf (stderr, "couldn't open pid %u\n", (unsigned) dwpid); + return; } if (!wait || WaitForSingleObject (h, 200) != WAIT_OBJECT_0) - if (!TerminateProcess (h, sig << 8)) + if (!TerminateProcess (h, sig << 8) + && WaitForSingleObject (h, 200) != WAIT_OBJECT_0) fprintf (stderr, "couldn't kill pid %u, %u\n", (unsigned) dwpid, (unsigned) GetLastError ()); CloseHandle (h); |