Skip to content

Commit

Permalink
avoid == for folating point numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
HiGarfield committed Apr 25, 2024
1 parent a61fb98 commit 02a2e37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/process_group.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ void update_process_group(struct process_group *pgroup)
continue;
/* process exists. update CPU usage */
sample = (tmp_process.cputime - p->cputime) / dt;
if (p->cpu_usage == -1)
if (p->cpu_usage < 0)
{
/* initialization */
p->cpu_usage = sample;
Expand Down

0 comments on commit 02a2e37

Please sign in to comment.