aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2018-03-28 13:23:53 +0100
committerRon Yorston <rmy@pobox.com>2018-03-28 13:23:53 +0100
commit49ef6618c2e101953032b2c660bf7b246d07ce2d (patch)
tree7f1bb4069f0968f56ca721871ac3965eb6b1b519 /include
parent9348221cef7762c2f5814f50b18c6a79701f5cda (diff)
downloadbusybox-w32-49ef6618c2e101953032b2c660bf7b246d07ce2d.tar.gz
busybox-w32-49ef6618c2e101953032b2c660bf7b246d07ce2d.tar.bz2
busybox-w32-49ef6618c2e101953032b2c660bf7b246d07ce2d.zip
ps: clear status for each process
The original procps_scan function takes care to clear the status information before handling each process. Do the same for the WIN32 version. This requires moving the snapshot handle to the part of the structure that isn't cleared on each iteration.
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 2c0e02971..244d85e84 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1840,7 +1840,11 @@ int FAST_FUNC procps_read_smaps(pid_t pid, struct smaprec *total,
1840 void (*cb)(struct smaprec *, void *), void *data); 1840 void (*cb)(struct smaprec *, void *), void *data);
1841 1841
1842typedef struct procps_status_t { 1842typedef struct procps_status_t {
1843#if !ENABLE_PLATFORM_MINGW32
1843 DIR *dir; 1844 DIR *dir;
1845#else
1846 HANDLE snapshot;
1847#endif
1844 IF_FEATURE_SHOW_THREADS(DIR *task_dir;) 1848 IF_FEATURE_SHOW_THREADS(DIR *task_dir;)
1845 uint8_t shift_pages_to_bytes; 1849 uint8_t shift_pages_to_bytes;
1846 uint8_t shift_pages_to_kb; 1850 uint8_t shift_pages_to_kb;
@@ -1879,9 +1883,6 @@ typedef struct procps_status_t {
1879#if ENABLE_FEATURE_TOP_SMP_PROCESS 1883#if ENABLE_FEATURE_TOP_SMP_PROCESS
1880 int last_seen_on_cpu; 1884 int last_seen_on_cpu;
1881#endif 1885#endif
1882#if ENABLE_PLATFORM_MINGW32
1883 HANDLE snapshot;
1884#endif
1885} procps_status_t; 1886} procps_status_t;
1886/* flag bits for procps_scan(xx, flags) calls */ 1887/* flag bits for procps_scan(xx, flags) calls */
1887enum { 1888enum {