diff options
author | Christopher Faylor <me@cgf.cx> | 2000-11-04 08:54:57 +0300 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-11-04 08:54:57 +0300 |
commit | e46db834d9c80be876d4ad9724fa5e9762c54528 (patch) | |
tree | 8572cf803d6c22421c35d34462a33d29a94139b4 /winsup/cygwin/pinfo.cc | |
parent | 46209564d41817b5d75671692152ccf3ae964dac (diff) |
* pinfo.cc (EnumProcessesNT): Avoid 0 pids.
(EnumProcesses9x): Ditto.
* sigproc.cc (remove_childe): Eliminate.
(proc_subproc): Move remove_child stuff here.
(wait_subproc): Synchronize with proc_subproc when error occurs. Add more
debugging info.
* sigproc.h (procstuff): Add an entry.
* spawn.cc (spawn_guts): Add sigframe here.
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r-- | winsup/cygwin/pinfo.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index 89dd7469e..5b825e1a5 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -327,14 +327,17 @@ EnumProcessesNT (DWORD* &pidlist, DWORD &npidlist) SYSTEM_PROCESSES *px = procs; for (;;) { - if (nelem >= npidlist) + if (px->ProcessId) { - npidlist += slop_pidlist; - pidlist = (DWORD *) realloc (pidlist, size_pidlist (npidlist)); + if (nelem >= npidlist) + { + npidlist += slop_pidlist; + pidlist = (DWORD *) realloc (pidlist, size_pidlist (npidlist)); + } + pidlist[nelem++] = cygwin_pid (px->ProcessId); + if (!px->NextEntryDelta) + break; } - pidlist[nelem++] = cygwin_pid (px->ProcessId); - if (!px->NextEntryDelta) - break; px = (SYSTEM_PROCESSES *) ((char *) px + px->NextEntryDelta); } @@ -359,6 +362,8 @@ EnumProcesses9x (DWORD* &pidlist, DWORD &npidlist) if (myProcess32First(h, &proc)) do { + if (!proc.th32ProcessID) + continue; if (nelem >= npidlist) { npidlist += slop_pidlist; |