aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-05-16 12:42:46 +0100
committerRon Yorston <rmy@pobox.com>2024-05-16 12:42:46 +0100
commit2a01fe0325524f7745f60a528d1f3076c098d89d (patch)
tree6fe1b772cc59cd258ca84f2ee29b58be6da150ab /include
parentf1fc5ab9d6980b88eede93051736305408774122 (diff)
downloadbusybox-w32-2a01fe0325524f7745f60a528d1f3076c098d89d.tar.gz
busybox-w32-2a01fe0325524f7745f60a528d1f3076c098d89d.tar.bz2
busybox-w32-2a01fe0325524f7745f60a528d1f3076c098d89d.zip
win32: ensure PIDs are read early in procps_scan()
Recent changes to allow orphaned processes to report a parent PID of 1 rely on the assumption that Process32First/Process32Next return parents before children. This isn't guaranteed by the API. Obtain all known PIDs on the first call to procps_scan() so that dead parents can be detected reliably. Costs 48 bytes.
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 8d5537114..d37d4e64c 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -2148,9 +2148,8 @@ typedef struct procps_status_t {
2148 DIR *dir; 2148 DIR *dir;
2149#else 2149#else
2150 HANDLE snapshot; 2150 HANDLE snapshot;
2151 unsigned *pids; 2151 DWORD *pids;
2152 int npids; 2152 int npids;
2153 int maxpids;
2154#endif 2153#endif
2155 IF_FEATURE_SHOW_THREADS(DIR *task_dir;) 2154 IF_FEATURE_SHOW_THREADS(DIR *task_dir;)
2156 uint8_t shift_pages_to_bytes; 2155 uint8_t shift_pages_to_bytes;