mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-02-12 21:57:27 +03:00
activate: use log_set_open_when_needed()
Otherwise, several error logs may not be shown. (cherry picked from commit a723521fd26d40ce90357e4e9b8131f1e1656ab5) (cherry picked from commit ce06e000b8b7d993670cdd2f827c92c7fef4c93e)
This commit is contained in:
parent
769d65988d
commit
b5f7c05204
@ -76,6 +76,8 @@ static int open_sockets(int *epoll_fd, bool accept) {
|
||||
except[i] = SD_LISTEN_FDS_START + i;
|
||||
|
||||
log_close();
|
||||
log_set_open_when_needed(true);
|
||||
|
||||
r = close_all_fds(except, n);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to close all file descriptors: %m");
|
||||
@ -88,17 +90,17 @@ static int open_sockets(int *epoll_fd, bool accept) {
|
||||
|
||||
STRV_FOREACH(address, arg_listen) {
|
||||
r = make_socket_fd(LOG_DEBUG, *address, arg_socket_type, (arg_accept * SOCK_CLOEXEC));
|
||||
if (r < 0) {
|
||||
log_open();
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to open '%s': %m", *address);
|
||||
}
|
||||
|
||||
assert(r == SD_LISTEN_FDS_START + count);
|
||||
count++;
|
||||
}
|
||||
|
||||
if (arg_listen)
|
||||
if (arg_listen) {
|
||||
log_open();
|
||||
log_set_open_when_needed(false);
|
||||
}
|
||||
|
||||
*epoll_fd = epoll_create1(EPOLL_CLOEXEC);
|
||||
if (*epoll_fd < 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user