summaryrefslogtreecommitdiff
path: root/src/journal-remote/journal-remote.c
diff options
context:
space:
mode:
authorDan Dedrick <ddedrick@lexmark.com>2016-05-04 17:06:45 -0400
committerDan Dedrick <ddedrick@lexmark.com>2016-10-10 15:11:01 -0400
commit800d3f3478b3dfd546344a4b8f5cc09860bd7da5 (patch)
tree9676b7403986b95214154cf48195e88b7ff277c8 /src/journal-remote/journal-remote.c
parent53c06862c12918ec717ea70918039765212eee95 (diff)
journal-remote: make the child pipe non-blocking
We are going to add this child as a source to our event loop so we don't want to block when reading data from it as this will prevent us from processing other events. Specifically this will block the signalfds which means if we are waiting for data from curl we won't handle SIGTERM or SIGINT until we happen to get more data.
Diffstat (limited to 'src/journal-remote/journal-remote.c')
-rw-r--r--src/journal-remote/journal-remote.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c
index a9009cfefe..d86c3681b1 100644
--- a/src/journal-remote/journal-remote.c
+++ b/src/journal-remote/journal-remote.c
@@ -127,6 +127,10 @@ static int spawn_child(const char* child, char** argv) {
if (r < 0)
log_warning_errno(errno, "Failed to close write end of pipe: %m");
+ r = fd_nonblock(fd[0], true);
+ if (r < 0)
+ log_warning_errno(errno, "Failed to set child pipe to non-blocking: %m");
+
return fd[0];
}