chiark / gitweb /
journal-remote: initialize writer hashmap before use
authorJonathan Liu <net147@gmail.com>
Wed, 24 Sep 2014 13:59:06 +0000 (23:59 +1000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 25 Sep 2014 22:19:03 +0000 (18:19 -0400)
https://bugs.freedesktop.org/show_bug.cgi?id=83682

[zj: move the initalization even earlier, before any sockets are
     looked at.]

src/journal-remote/journal-remote.c

index f06c2cb..ad87783 100644 (file)
@@ -819,6 +819,10 @@ static int remoteserver_init(RemoteServer *s,
         assert(server == NULL);
         server = s;
 
+        r = init_writer_hashmap(s);
+        if (r < 0)
+                return r;
+
         n = sd_listen_fds(true);
         if (n < 0) {
                 log_error("Failed to read listening file descriptors from environment: %s",
@@ -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