diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-04-13 13:58:50 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-04-13 13:58:50 +0200 |
commit | 7ea07dcddafe573c699fc48171b57b912897e7e2 (patch) | |
tree | 35f8fb250e06a24b2c55b42359b001bd8a2ee9d9 | |
parent | 64695e53a0f425b831ba90d467f0e7a668c1b33c (diff) |
fix a couple of things found with the llvm static analyzer
-rw-r--r-- | src/core/manager.c | 2 | ||||
-rw-r--r-- | src/journal/journal-file.c | 2 | ||||
-rw-r--r-- | src/journal/journald.c | 2 | ||||
-rw-r--r-- | src/shared/logs-show.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/src/core/manager.c b/src/core/manager.c index 6be8e8fbe2..2801500f90 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -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); diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index 973c51f802..a60a896c2f 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -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; diff --git a/src/journal/journald.c b/src/journal/journald.c index 2e2d30f8e8..97d2ec05c7 100644 --- a/src/journal/journald.c +++ b/src/journal/journald.c @@ -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; diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c index fedb4532db..4c59ca34cd 100644 --- a/src/shared/logs-show.c +++ b/src/shared/logs-show.c @@ -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; |