logcatd: fix sd_journal_seek_tail doesn't go to end (#23319)

* fix sd_journal_seek_tail doesn't go to end

* add comment
pull/23326/head
Dean Lee 3 years ago committed by GitHub
parent 937a0df57b
commit f2c17bbcde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      selfdrive/logcatd/logcatd_systemd.cc

@ -24,6 +24,10 @@ int main(int argc, char *argv[]) {
err = sd_journal_seek_tail(journal); err = sd_journal_seek_tail(journal);
assert(err >= 0); assert(err >= 0);
// workaround for bug https://github.com/systemd/systemd/issues/9934
// call sd_journal_previous_skip after sd_journal_seek_tail (like journalctl -f does) to makes things work.
sd_journal_previous_skip(journal, 1);
while (!do_exit) { while (!do_exit) {
err = sd_journal_next(journal); err = sd_journal_next(journal);
assert(err >= 0); assert(err >= 0);

Loading…
Cancel
Save