Skip to content

Commit

Permalink
top: do not print ${top mem 1} as inf if $mem not used
Browse files Browse the repository at this point in the history
  • Loading branch information
bi4k8 authored and bi4k8 committed May 5, 2023
1 parent b3766fe commit 7fa3d11
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/top.cc
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,11 @@ static void process_find_top(struct process **cpu, struct process **mem,
}

int update_top() {
// if nothing else has ever set up info, we need to update it here, because
// info.memmax is used to print percentages in `print_top_mem`
if (info.memmax == 0) {
update_meminfo();
}
process_find_top(info.cpu, info.memu, info.time
#ifdef BUILD_IOSTATS
,
Expand Down

0 comments on commit 7fa3d11

Please sign in to comment.