chiark / gitweb /
journalctl: respect --after-cursor semantics with --follow in all cases
[elogind.git] / src / journal / journal-file.c
index d06dbc2f753397efd6408a0d451fd6ab914cc948..c5d2d19433a0aeabd0d01b5edf172be5f9cbef65 100644 (file)
@@ -1292,7 +1292,7 @@ void journal_file_post_change(JournalFile *f) {
         __sync_synchronize();
 
         if (ftruncate(f->fd, f->last_stat.st_size) < 0)
-                log_error("Failed to truncate file to its own size: %m");
+                log_error_errno(errno, "Failed to truncate file to its own size: %m");
 }
 
 static int entry_item_cmp(const void *_a, const void *_b) {
@@ -1380,9 +1380,10 @@ static void chain_cache_put(
                 if (array == first)
                         return;
 
-                if (ordered_hashmap_size(h) >= CHAIN_CACHE_MAX)
+                if (ordered_hashmap_size(h) >= CHAIN_CACHE_MAX) {
                         ci = ordered_hashmap_steal_first(h);
-                else {
+                        assert(ci);
+                } else {
                         ci = new(ChainCacheItem, 1);
                         if (!ci)
                                 return;
@@ -1656,7 +1657,7 @@ static int generic_array_bisect(
                         }
                 }
 
-                if (k > n) {
+                if (k >= n) {
                         if (direction == DIRECTION_UP) {
                                 i = n;
                                 subtract_one = true;