chiark / gitweb /
automount: add expire support
[elogind.git] / src / shared / logs-show.c
index d3ee1398806223c594457fcbc1baa1f9e6a05a3d..27f407229fe24cde11772d6c21ac7e26de3d235b 100644 (file)
@@ -31,6 +31,9 @@
 #include "utf8.h"
 #include "hashmap.h"
 #include "journal-internal.h"
+#include "formats-util.h"
+#include "process-util.h"
+#include "terminal-util.h"
 
 /* up to three lines (each up to 100 characters),
    or 300 characters, whichever is less */
@@ -990,7 +993,7 @@ static int show_journal(FILE *f,
 
                 if (warn_cutoff && line < how_many && not_before > 0) {
                         sd_id128_t boot_id;
-                        usec_t cutoff;
+                        usec_t cutoff = 0;
 
                         /* Check whether the cutoff line is too early */
 
@@ -1165,7 +1168,7 @@ static int get_boot_id_for_machine(const char *machine, sd_id128_t *boot_id) {
 
                 r = loop_read_exact(fd, buf, 36, false);
                 safe_close(fd);
-                if (k < 0)
+                if (r < 0)
                         _exit(EXIT_FAILURE);
 
                 k = send(pair[1], buf, 36, MSG_NOSIGNAL);