Skip to content

Commit 5245240

Browse files
yuwatabluca
authored andcommitted
logs-show: do not use _SOURCE_MONOTONIC_TIMESTAMP field
The timestamp is not in CLOCK_MONOTONIC, but CLOCK_BOOTTIME, while header monotonic timestamp is in CLOCK_MONOTONIC. Hence, we cannot adjust timestamp by comparing with header monotonic timestamp and _SOURCE_MONOTONIC_TIMESTAMP field. Fixes a regression caused by affde1d. Fixes systemd#33293. (cherry picked from commit 144498e)
1 parent f48dd79 commit 5245240

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/shared/logs-show.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,9 @@ static void parse_display_realtime(
450450
assert(j);
451451
assert(ret);
452452

453+
// FIXME: _SOURCE_MONOTONIC_TIMESTAMP is in CLOCK_BOOTTIME, hence we cannot use it for adjusting realtime.
454+
source_monotonic = NULL;
455+
453456
/* First, try _SOURCE_REALTIME_TIMESTAMP. */
454457
if (source_realtime && safe_atou64(source_realtime, &t) >= 0 && VALID_REALTIME(t)) {
455458
*ret = t;
@@ -488,6 +491,9 @@ static void parse_display_timestamp(
488491
assert(ret_display_ts);
489492
assert(ret_boot_id);
490493

494+
// FIXME: _SOURCE_MONOTONIC_TIMESTAMP is in CLOCK_BOOTTIME, hence we cannot use it for adjusting realtime.
495+
source_monotonic = NULL;
496+
491497
if (source_realtime && safe_atou64(source_realtime, &t) >= 0 && VALID_REALTIME(t))
492498
source_ts.realtime = t;
493499

0 commit comments

Comments
 (0)