From: Ingo Saitz Date: Fri, 6 Jan 2023 02:30:39 +0000 (+1100) Subject: vmstat: Update memory statistics X-Git-Tag: v4.0.3_rc1~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7e24816538b777fe0b3f709df3b9c1824681461c;p=procps-ng vmstat: Update memory statistics vmstat 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 --- diff --git a/NEWS b/NEWS index 8a2d6b04..d23922af 100644 --- a/NEWS +++ b/NEWS @@ -1,8 +1,10 @@ procps-ng-NEXT --------------- * docs: Don't install English manpages twice - * skill: Match on -p again Debian #1025915 * ps: c flag shows command name again Debian #1026326 + * skill: Match on -p again Debian #1025915 + * vmstat: Referesh memory statistics Debian #1027963 + procps-ng-4.0.2 --------------- * library revision - 0:1:0 diff --git a/src/vmstat.c b/src/vmstat.c index 86109835..d076cf21 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 );