|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From 22259a00fdb54dee818eeb1019421e2c516a330d Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: Jonathan Liu <net147@gmail.com>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Wed, 24 Sep 2014 23:59:06 +1000
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] journal-remote: initialize writer hashmap before use
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
https://bugs.freedesktop.org/show_bug.cgi?id=83682
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
[zj: move the initalization even earlier, before any sockets are
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
looked at.]
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/journal-remote/journal-remote.c | 8 ++++----
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index f06c2cb249..ad87783510 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/journal-remote/journal-remote.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/journal-remote/journal-remote.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -819,6 +819,10 @@ static int remoteserver_init(RemoteServer *s,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
assert(server == NULL);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
server = s;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ r = init_writer_hashmap(s);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ return r;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
n = sd_listen_fds(true);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
if (n < 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
log_error("Failed to read listening file descriptors from environment: %s",
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -942,10 +946,6 @@ static int remoteserver_init(RemoteServer *s,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return -EINVAL;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- r = init_writer_hashmap(s);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- return r;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
if (arg_split_mode == JOURNAL_WRITE_SPLIT_NONE) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
/* In this case we know what the writer will be
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
called, so we can create it and verify that we can
|