summaryrefslogtreecommitdiffstats
path: root/src/journal-remote/journal-remote-main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/journal-remote/journal-remote-main.c')
-rw-r--r--src/journal-remote/journal-remote-main.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/src/journal-remote/journal-remote-main.c b/src/journal-remote/journal-remote-main.c
index 3141c8a..1c993a2 100644
--- a/src/journal-remote/journal-remote-main.c
+++ b/src/journal-remote/journal-remote-main.c
@@ -107,7 +107,7 @@ static int spawn_child(const char* child, char** argv) {
r = fd_nonblock(fd[0], true);
if (r < 0)
- log_warning_errno(errno, "Failed to set child pipe to non-blocking: %m");
+ log_warning_errno(r, "Failed to set child pipe to non-blocking: %m");
return fd[0];
}
@@ -560,24 +560,6 @@ static int dispatch_http_event(sd_event_source *event,
**********************************************************************
**********************************************************************/
-static int setup_signals(RemoteServer *s) {
- int r;
-
- assert(s);
-
- assert_se(sigprocmask_many(SIG_SETMASK, NULL, SIGINT, SIGTERM, -1) >= 0);
-
- r = sd_event_add_signal(s->events, &s->sigterm_event, SIGTERM, NULL, s);
- if (r < 0)
- return r;
-
- r = sd_event_add_signal(s->events, &s->sigint_event, SIGINT, NULL, s);
- if (r < 0)
- return r;
-
- return 0;
-}
-
static int setup_raw_socket(RemoteServer *s, const char *address) {
int fd;
@@ -605,9 +587,9 @@ static int create_remoteserver(
if (r < 0)
return r;
- r = setup_signals(s);
+ r = sd_event_set_signal_exit(s->events, true);
if (r < 0)
- return log_error_errno(r, "Failed to set up signals: %m");
+ return log_error_errno(r, "Failed to install SIGINT/SIGTERM handlers: %m");
n = sd_listen_fds(true);
if (n < 0)