From: Amaury Denoyelle Date: Fri, 10 Feb 2023 14:25:45 +0000 (+0100) Subject: BUG/MINOR: mworker: fix uptime for master process X-Git-Tag: v2.8-dev4~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2776e775ecccc555a1d079af03d2747e825c2b96;p=thirdparty%2Fhaproxy.git BUG/MINOR: mworker: fix uptime for master process Uptime calculation for master process was incorrect as it used as its timestamp base time. Fix this by using the scheduler 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. 28360dc53f715c497fff822523f92769d8b1627d MEDIUM: clock: force internal time to wrap early after boot This should be backported up to 2.0. --- diff --git a/src/haproxy.c b/src/haproxy.c index f7e0b34ac1..507a4aa45f 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -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);