If _SOURCE_MONOTONIC_TIMESTAMP was set in the entry, we wouldn't
query the boot ID, leading to every kernel entry in the export mode
to have BOOT_ID=
000000000000000. Let's fix this by always querying
the boot ID.
if (monotonic)
r = safe_atou64(monotonic, &ret_ts->monotonic);
- if (!monotonic || r < 0 || !VALID_MONOTONIC(ret_ts->monotonic))
- r = sd_journal_get_monotonic_usec(j, &ret_ts->monotonic, ret_boot_id);
+ r = sd_journal_get_monotonic_usec(
+ j,
+ !monotonic || r < 0 || !VALID_MONOTONIC(ret_ts->monotonic) ? &ret_ts->monotonic : NULL,
+ ret_boot_id);
if (r < 0)
ret_ts->monotonic = USEC_INFINITY;