]> err.no Git - systemd/commitdiff
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 6be8e8fbe2727dcb5d0819e56fc5410882ed7664..2801500f901d80dd1bbc42b77ce0ed8843c1d68e 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 973c51f802e02027c5e391c143497284796d1d36..a60a896c2f3ad7370f43abf8ba97514d0c9f20d2 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 2e2d30f8e8df4a7a63f29c9fc1f24504dd140ed3..97d2ec05c7873eee59cab9aa2aac88ad4e271fff 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 fedb4532db2505ea5b1bdf385ad312fcf152ded5..4c59ca34cd55d8b132682b52ba8fe9024e130007 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;