diff options
author | Ingo Saitz <ingo@hannover.ccc.de> | 2023-01-06 13:30:39 +1100 |
---|---|---|
committer | Craig Small <csmall@dropbear.xyz> | 2023-01-06 13:30:39 +1100 |
commit | 7e24816538b777fe0b3f709df3b9c1824681461c (patch) | |
tree | 25ca62973342e668e997490d3334b28fc0819e54 /src | |
parent | dd3cb0892d142e370413e1cba582d390042883e5 (diff) | |
download | procps-ng-7e24816538b777fe0b3f709df3b9c1824681461c.tar.gz |
vmstat: Update memory statistics
vmstat <n> would update most fields, but the memory statistics
were only fetched the first time.
References:
https://bugs.debian.org/1027963
Signed-off-by: Craig Small <csmall@dropbear.xyz>
Diffstat (limited to 'src')
-rw-r--r-- | src/vmstat.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vmstat.c b/src/vmstat.c index 8610983..d076cf2 100644 --- a/src/vmstat.c +++ b/src/vmstat.c @@ -468,6 +468,9 @@ static void new_format(void) pswpin[tog] = VMSTAT_GET(vm_info, VMSTAT_PSWPIN, ul_int); pswpout[tog] = VMSTAT_GET(vm_info, VMSTAT_PSWPOUT, ul_int); + if (!(mem_stack = procps_meminfo_select(mem_info, Mem_items, MAX_mem))) + xerrx(EXIT_FAILURE, _("Unable to select memory information")); + if (t_option) { (void) time( &the_time ); tm_ptr = localtime( &the_time ); |