[pve-devel] [PATCH mini-journalreader 3/5] reuse get_timestamp

Dominik Csapak d.csapak at proxmox.com
Thu May 16 11:32:30 CEST 2019


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 src/mini-journalreader.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/mini-journalreader.c b/src/mini-journalreader.c
index 0747d7c..1586592 100644
--- a/src/mini-journalreader.c
+++ b/src/mini-journalreader.c
@@ -110,11 +110,9 @@ static void print_reboot(sd_journal *j) {
 }
 
 static void print_timestamp(sd_journal *j) {
-    uint64_t timestamp;
-    int r = sd_journal_get_realtime_usec(j, &timestamp);
-    if (r < 0) {
-        fprintf(stderr, "Failed  %s\n", strerror(-r));
-        return;
+    uint64_t timestamp = get_timestamp(j);
+    if (timestamp == (uint64_t)-1) {
+	return;
     }
 
     static uint64_t last_timestamp;
-- 
2.11.0





More information about the pve-devel mailing list