* Makefile.in: Display "..." when not-verbose.

* kill.cc (forcekill): Default to entered pid when pinfo fails.  Issue some
warnings when things don't work.
This commit is contained in:
Christopher Faylor 2003-09-01 01:57:44 +00:00
parent 12ffca1d84
commit 40d885eb7b
3 changed files with 15 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2003-08-31 Christopher Faylor <cgf@redhat.com>
* Makefile.in: Display "..." when not-verbose.
* kill.cc (forcekill): Default to entered pid when pinfo fails. Issue
some warnings when things don't work.
2003-08-17 David Rothenberger <daveroth@acm.org>
* dump_setup.cc (check_package_files): Strip leading / and ./ from

View File

@ -205,7 +205,7 @@ endif
%.exe: %.o $(ALL_DEP_LDLIBS)
ifdef VERBOSE
$(CXX) -o $@ ${firstword $^} -B$(cygwin_build)/ $(ALL_LDFLAGS)
$(CXX) -o $@ ${firstword $^} -B$(cygwin_build)/ ... $(ALL_LDFLAGS)
else
@echo $(CXX) -o $@ ${firstword $^} ${filter-out -B%, $(ALL_LDFLAGS)};\
$(CXX) -o $@ ${firstword $^} -B$(cygwin_build)/ $(ALL_LDFLAGS)

View File

@ -129,13 +129,16 @@ static void __stdcall
forcekill (int pid, int sig, int wait)
{
external_pinfo *p = (external_pinfo *) cygwin_internal (CW_GETPINFO_FULL, pid);
if (!p)
return;
HANDLE h = OpenProcess (PROCESS_TERMINATE, FALSE, (DWORD) p->dwProcessId);
DWORD dwpid = p ? p->dwProcessId : (DWORD) pid;
HANDLE h = OpenProcess (PROCESS_TERMINATE, FALSE, (DWORD) dwpid);
if (!h)
{
fprintf (stderr, "couldn't open pid %u\n", dwpid);
return;
}
if (!wait || WaitForSingleObject (h, 200) != WAIT_OBJECT_0)
TerminateProcess (h, sig << 8);
if (!TerminateProcess (h, sig << 8))
fprintf (stderr, "couldn't kill pid %u, %d\n", dwpid, GetLastError ());
CloseHandle (h);
}