chiark / gitweb /
fix a couple of things found with the llvm static analyzer
authorLennart Poettering <lennart@poettering.net>
Fri, 13 Apr 2012 11:58:50 +0000 (13:58 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 13 Apr 2012 11:58:50 +0000 (13:58 +0200)
src/core/manager.c
src/journal/journal-file.c
src/journal/journald.c
src/shared/logs-show.c

index 6be8e8f..2801500 100644 (file)
@@ -3015,7 +3015,7 @@ bool manager_unit_pending_inactive(Manager *m, const char *name) {
 
 void manager_check_finished(Manager *m) {
         char userspace[FORMAT_TIMESPAN_MAX], initrd[FORMAT_TIMESPAN_MAX], kernel[FORMAT_TIMESPAN_MAX], sum[FORMAT_TIMESPAN_MAX];
-        usec_t kernel_usec = 0, initrd_usec = 0, userspace_usec = 0, total_usec = 0;
+        usec_t kernel_usec, initrd_usec, userspace_usec, total_usec;
 
         assert(m);
 
index 973c51f..a60a896 100644 (file)
@@ -1977,7 +1977,7 @@ int journal_directory_vacuum(const char *directory, uint64_t max_use, uint64_t m
                 size_t q;
                 struct stat st;
                 char *p;
-                unsigned long long seqnum, realtime;
+                unsigned long long seqnum = 0, realtime;
                 sd_id128_t seqnum_id;
                 bool have_seqnum;
 
index 2e2d30f..97d2ec0 100644 (file)
@@ -1148,7 +1148,7 @@ static void process_native_message(
         char *identifier = NULL, *message = NULL;
 
         assert(s);
-        assert(buffer || n == 0);
+        assert(buffer || buffer_size == 0);
 
         p = buffer;
         remaining = buffer_size;
index fedb453..4c59ca3 100644 (file)
@@ -554,7 +554,7 @@ int show_journal_by_unit(
                 bool follow) {
 
         char *m = NULL;
-        sd_journal *j;
+        sd_journal *j = NULL;
         int r;
         int fd;
         unsigned line = 0;