mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-06 14:30:38 +08:00
* kill.c (forcekill): Wait for process to terminate even if TerminateProcess
says it failed.
This commit is contained in:
parent
276448cf67
commit
a98a001169
@ -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>
|
2003-09-11 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* Makefile.in: Tweak mingw libz.a detection to make it more reliably
|
* Makefile.in: Tweak mingw libz.a detection to make it more reliably
|
||||||
|
@ -133,11 +133,12 @@ forcekill (int pid, int sig, int wait)
|
|||||||
HANDLE h = OpenProcess (PROCESS_TERMINATE, FALSE, (DWORD) dwpid);
|
HANDLE h = OpenProcess (PROCESS_TERMINATE, FALSE, (DWORD) dwpid);
|
||||||
if (!h)
|
if (!h)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "couldn't open pid %u\n", (unsigned) dwpid);
|
fprintf (stderr, "couldn't open pid %u\n", (unsigned) dwpid);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!wait || WaitForSingleObject (h, 200) != WAIT_OBJECT_0)
|
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,
|
fprintf (stderr, "couldn't kill pid %u, %u\n", (unsigned) dwpid,
|
||||||
(unsigned) GetLastError ());
|
(unsigned) GetLastError ());
|
||||||
CloseHandle (h);
|
CloseHandle (h);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user