]> git.proxmox.com Git - proxmox-mini-journalreader.git/commitdiff
reuse get_timestamp
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 16 May 2019 10:22:17 +0000 (12:22 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 16 May 2019 14:48:58 +0000 (16:48 +0200)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/mini-journalreader.c

index 0747d7ca7d0733ab1e31dd150e5ce8299d613b81..15865921df4db12927471b8799d44cc847a72d5c 100644 (file)
@@ -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;