diff options
author | Christopher Faylor <me@cgf.cx> | 2003-09-13 18:20:52 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2003-09-13 18:20:52 +0000 |
commit | a98a0011695d362f4f00b6ad66a30a2651c49e43 (patch) | |
tree | 389e2ac272da8570e49041318455ccfd79647b08 | |
parent | 276448cf67102d31ccd1c5b4186ac84aeeabf9d2 (diff) | |
download | cygnal-a98a0011695d362f4f00b6ad66a30a2651c49e43.tar.gz cygnal-a98a0011695d362f4f00b6ad66a30a2651c49e43.tar.bz2 cygnal-a98a0011695d362f4f00b6ad66a30a2651c49e43.zip |
* kill.c (forcekill): Wait for process to terminate even if TerminateProcess
says it failed.
-rw-r--r-- | winsup/utils/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/utils/kill.cc | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index e6b79649b..2e930846c 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,8 @@ +2003-09-13 Christopher Faylor <cgf@redhat.com> + + * kill.c (forcekill): Wait for process to terminate even if + TerminateProcess says it failed. + 2003-09-11 Christopher Faylor <cgf@redhat.com> * Makefile.in: Tweak mingw libz.a detection to make it more reliably 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); |