naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
5808e7
From 7e4b7cc35af0e3b3afbf32fa0fd9961cd01ad9a9 Mon Sep 17 00:00:00 2001
5808e7
From: Yu Watanabe <watanabe.yu+github@gmail.com>
5808e7
Date: Mon, 22 Jul 2019 10:52:12 +0900
5808e7
Subject: [PATCH] pstore: drop unnecessary initializations
5808e7
5808e7
(cherry picked from commit 2e4effd129343d22bfed34e94810d3f87c8f0e85)
5808e7
5808e7
Related: #2158832
5808e7
---
5808e7
 src/pstore/pstore.c | 15 ++++++---------
5808e7
 1 file changed, 6 insertions(+), 9 deletions(-)
5808e7
5808e7
diff --git a/src/pstore/pstore.c b/src/pstore/pstore.c
5808e7
index f95e016eb6..e6a342fc50 100644
5808e7
--- a/src/pstore/pstore.c
5808e7
+++ b/src/pstore/pstore.c
5808e7
@@ -113,14 +113,12 @@ static int compare_pstore_entries(const void *_a, const void *_b) {
5808e7
 }
5808e7
 
5808e7
 static int move_file(PStoreEntry *pe, const char *subdir) {
5808e7
-        _cleanup_free_ char *ifd_path = NULL;
5808e7
-        _cleanup_free_ char *ofd_path = NULL;
5808e7
-        int r = 0;
5808e7
-        struct iovec iovec[2] = {};
5808e7
-        int n_iovec = 0;
5808e7
+        _cleanup_free_ char *ifd_path = NULL, *ofd_path = NULL;
5808e7
         _cleanup_free_ void *field = NULL;
5808e7
-        const char *suffix = NULL;
5808e7
+        struct iovec iovec[2];
5808e7
+        const char *suffix;
5808e7
         size_t field_size;
5808e7
+        int n_iovec = 0, r;
5808e7
 
5808e7
         if (pe->handled)
5808e7
                 return 0;
5808e7
@@ -202,10 +200,9 @@ static int write_dmesg(const char *dmesg, size_t size, const char *id) {
5808e7
 
5808e7
 static void process_dmesg_files(PStoreList *list) {
5808e7
         /* Move files, reconstruct dmesg.txt */
5808e7
-        PStoreEntry *pe;
5808e7
-        _cleanup_free_ char *dmesg = NULL;
5808e7
+        _cleanup_free_ char *dmesg = NULL, *dmesg_id = NULL;
5808e7
         size_t dmesg_size = 0;
5808e7
-        _cleanup_free_ char *dmesg_id = NULL;
5808e7
+        PStoreEntry *pe;
5808e7
 
5808e7
         /* Handle each dmesg file: files processed in reverse
5808e7
          * order so as to properly reconstruct original dmesg */