diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index 1acf814a8..7e136c366 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,12 @@ +Sun Oct 8 23:11:17 2000 Christopher Faylor + + * ps.cc (main): Change order of reporting slightly so that windows pids + are more obvious. + * strace.cc (add_child): Just add child's pid directly. + (remove_child): No need to close the child process pid since + ContinueDebugEvent does that automatically. + (proc_child): Ditto for child thread. + Fri Sep 29 13:12:00 2000 Corinna Vinschen * cygcheck.cc (keyeprint): New function. diff --git a/winsup/utils/kill.cc b/winsup/utils/kill.cc index 7a3be9b35..961475680 100644 --- a/winsup/utils/kill.cc +++ b/winsup/utils/kill.cc @@ -74,7 +74,7 @@ sig0: } else { - if (errno == ESRCH && force && sig != 0) + if (force && sig != 0) forcekill (pid, sig, 0); else { diff --git a/winsup/utils/ps.cc b/winsup/utils/ps.cc index 413defea3..b9c391ffa 100644 --- a/winsup/utils/ps.cc +++ b/winsup/utils/ps.cc @@ -175,8 +175,8 @@ main (int argc, char *argv[]) const char *dfmt = "%5d%4d%10s %s\n"; const char *ftitle = " UID PID PPID TTY STIME COMMAND\n"; const char *ffmt = "%8.8s%6d%6d%4d%10s %s\n"; - const char *ltitle = " PID PPID PGID WINPID UID TTY STIME COMMAND\n"; - const char *lfmt = "%c %5d %5d %5d %8u %4d %3d %8s %s\n"; + const char *ltitle = " PID PPID PGID WINPID TTY UID STIME COMMAND\n"; + const char *lfmt = "%c %5d %5d %5d %8u %3d %4d %8s %s\n"; char ch; aflag = lflag = fflag = sflag = 0; @@ -305,7 +305,7 @@ main (int argc, char *argv[]) printf (ffmt, uname, p->pid, p->ppid, p->ctty, start_time (p), pname); else if (lflag) printf (lfmt, status, p->pid, p->ppid, p->pgid, - p->dwProcessId, p->uid, p->ctty, start_time (p), pname); + p->dwProcessId, p->ctty, p->uid, start_time (p), pname); } (void) cygwin_internal (CW_UNLOCK_PINFO); diff --git a/winsup/utils/strace.cc b/winsup/utils/strace.cc index dc6795cbb..a958aa431 100644 --- a/winsup/utils/strace.cc +++ b/winsup/utils/strace.cc @@ -93,10 +93,7 @@ add_child (DWORD id, HANDLE hproc) children.next->next = c; lastid = children.next->id = id; HANDLE me = GetCurrentProcess (); - if (!DuplicateHandle (me, hproc, me, &children.next->hproc, PROCFLAGS, - FALSE, DUPLICATE_CLOSE_SOURCE)) - error (0, "couldn't duplicate %p,%p", me, hproc); - lasth = children.next->hproc; + lasth = children.next->hproc = hproc; } static child_list * @@ -120,7 +117,6 @@ remove_child (DWORD id) if (c->next->id == id) { child_list *c1 = c->next; - close_handle (c1->hproc, id); c->next = c1->next; delete c1; return; @@ -516,15 +512,11 @@ proc_child (unsigned mask, FILE *ofile) case CREATE_PROCESS_DEBUG_EVENT: if (ev.u.CreateProcessInfo.hFile) CloseHandle (ev.u.CreateProcessInfo.hFile); - if (ev.u.CreateProcessInfo.hThread) - CloseHandle (ev.u.CreateProcessInfo.hThread); add_child (ev.dwProcessId, ev.u.CreateProcessInfo.hProcess); processes++; break; case CREATE_THREAD_DEBUG_EVENT: - if (ev.u.CreateThread.hThread) - CloseHandle (ev.u.CreateThread.hThread); break; case LOAD_DLL_DEBUG_EVENT: