BUG/MINOR: mworker: fix uptime for master process

Uptime calculation for master process was incorrect as it used
<start_date> as its timestamp base time. Fix this by using the scheduler
time <start_time> for this.

The impact of this bug is minor as timestamp base time is only used for
"show proc" CLI output. it was highlighted by the following commit.
which caused a negative value to be displayed for the master process
uptime on "show proc" output.

  28360dc53f
  MEDIUM: clock: force internal time to wrap early after boot

This should be backported up to 2.0.
This commit is contained in:
Amaury Denoyelle 2023-02-10 15:25:45 +01:00
parent a9de25a559
commit 2776e775ec

View File

@ -2144,7 +2144,7 @@ static void init(int argc, char **argv)
}
tmproc->options |= PROC_O_TYPE_MASTER; /* master */
tmproc->pid = pid;
tmproc->timestamp = start_date.tv_sec;
tmproc->timestamp = start_time.tv_sec;
proc_self = tmproc;
LIST_APPEND(&proc_list, &tmproc->list);