[systemd-devel] [PATCH] journal-remote: initialize writer hashmap before use

Jonathan Liu net147 at gmail.com
Wed Sep 24 06:59:06 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=83682
---
 src/journal-remote/journal-remote.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c
index f06c2cb..b1cc6fd 100644
--- a/src/journal-remote/journal-remote.c
+++ b/src/journal-remote/journal-remote.c
@@ -913,6 +913,10 @@ static int remoteserver_init(RemoteServer *s,
                         return r;
         }
 
+        r = init_writer_hashmap(s);
+        if (r < 0)
+                return r;
+
         STRV_FOREACH(file, arg_files) {
                 const char *output_name;
 
@@ -942,10 +946,6 @@ static int remoteserver_init(RemoteServer *s,
                 return -EINVAL;
         }
 
-        r = init_writer_hashmap(s);
-        if (r < 0)
-                return r;
-
         if (arg_split_mode == JOURNAL_WRITE_SPLIT_NONE) {
                 /* In this case we know what the writer will be
                    called, so we can create it and verify that we can
-- 
2.1.0



More information about the systemd-devel mailing list