]> git.proxmox.com Git - proxmox-mini-journalreader.git/blobdiff - src/mini-journalreader.c
reuse get_timestamp
[proxmox-mini-journalreader.git] / 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;