diff options
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/utils/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/utils/Makefile.in | 2 | ||||
-rw-r--r-- | winsup/utils/kill.cc | 11 |
3 files changed, 15 insertions, 5 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index 639d05b33..b5b1bcd80 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -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 diff --git a/winsup/utils/Makefile.in b/winsup/utils/Makefile.in index a52d48fca..c76187c0a 100644 --- a/winsup/utils/Makefile.in +++ b/winsup/utils/Makefile.in @@ -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) diff --git a/winsup/utils/kill.cc b/winsup/utils/kill.cc index b0a2e1f65..3c75c5078 100644 --- a/winsup/utils/kill.cc +++ b/winsup/utils/kill.cc @@ -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); } |