journald: move server_restore_streams out of server_open_stdout_socket
One has little to do with the other, so it's confusing that the second also calls the first.
This commit is contained in:
@@ -1561,15 +1561,18 @@ int server_init(Server *s) {
|
||||
}
|
||||
}
|
||||
|
||||
r = server_open_stdout_socket(s, fds);
|
||||
if (r < 0)
|
||||
return r;
|
||||
/* Try to restore streams, but don't bother if this fails */
|
||||
(void) server_restore_streams(s, fds);
|
||||
|
||||
if (fdset_size(fds) > 0) {
|
||||
log_warning("%u unknown file descriptors passed, closing.", fdset_size(fds));
|
||||
fds = fdset_free(fds);
|
||||
}
|
||||
|
||||
r = server_open_stdout_socket(s);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = server_open_syslog_socket(s);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
@@ -629,7 +629,7 @@ static int stdout_stream_restore(Server *s, const char *fname, int fd) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int server_restore_streams(Server *s, FDSet *fds) {
|
||||
int server_restore_streams(Server *s, FDSet *fds) {
|
||||
_cleanup_closedir_ DIR *d = NULL;
|
||||
struct dirent *de;
|
||||
int r;
|
||||
@@ -683,7 +683,7 @@ fail:
|
||||
return log_error_errno(errno, "Failed to read streams directory: %m");
|
||||
}
|
||||
|
||||
int server_open_stdout_socket(Server *s, FDSet *fds) {
|
||||
int server_open_stdout_socket(Server *s) {
|
||||
int r;
|
||||
|
||||
assert(s);
|
||||
@@ -719,8 +719,5 @@ int server_open_stdout_socket(Server *s, FDSet *fds) {
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to adjust priority of stdout server event source: %m");
|
||||
|
||||
/* Try to restore streams, but don't bother if this fails */
|
||||
(void) server_restore_streams(s, fds);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
#include "fdset.h"
|
||||
#include "journald-server.h"
|
||||
|
||||
int server_open_stdout_socket(Server *s, FDSet *fds);
|
||||
|
||||
int server_open_stdout_socket(Server *s);
|
||||
int server_restore_streams(Server *s, FDSet *fds);
|
||||
void stdout_stream_free(StdoutStream *s);
|
||||
|
||||
Reference in New Issue
Block a user