From 6104e4c09ec277056a345fc1e4a4bfcf5ffe042e Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Mon, 4 Jan 2021 23:48:04 +0800 Subject: [PATCH] simplify logcatd (#19640) * simplify logcatd * add assert * revert opendbc * revert opendbc --- selfdrive/logcatd/logcatd_systemd.cc | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/selfdrive/logcatd/logcatd_systemd.cc b/selfdrive/logcatd/logcatd_systemd.cc index 30938ce862..efa84d3d7d 100644 --- a/selfdrive/logcatd/logcatd_systemd.cc +++ b/selfdrive/logcatd/logcatd_systemd.cc @@ -36,17 +36,9 @@ int main(int argc, char *argv[]) { // Wait for new message if we didn't receive anything if (r == 0){ - do { - r = sd_journal_wait(journal, 1000 * 1000); - assert(r >= 0); - } while (r == SD_JOURNAL_NOP && !do_exit); - - if (do_exit) break; - - r = sd_journal_next(journal); - assert(r >= 0); - - if (r == 0) continue; // Try again if we still didn't get anything + r = sd_journal_wait(journal, 1000 * 1000); + assert (r >= 0); + continue; // Try again } uint64_t timestamp = 0;