chiark / gitweb /
logs-show: fix check of loop_read_exact
[elogind.git] / src / shared / logs-show.c
index d3ee1398806223c594457fcbc1baa1f9e6a05a3d..5a3ab3da3ee505f00f2bd235de278f82cbe1a21c 100644 (file)
@@ -1165,7 +1165,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);