summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-08-30 23:31:27 +0200
committerLennart Poettering <lennart@poettering.net>2010-08-30 23:31:27 +0200
commitda726a4d4dc324b35c703fd2dc5f60b460ce8091 (patch)
tree278e8e7f49a2c4f360f2ddf5cb990bfdbd1119af /src
parent2528a7a62c4ad9b2f4773b608d208239299da50c (diff)
exec: make sure O_NONBLOCK is off for all sockets passed as STDIN/STDOUT/STDERR
Diffstat (limited to 'src')
-rw-r--r--src/execute.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/execute.c b/src/execute.c
index f35e916e4c..2443d9c74d 100644
--- a/src/execute.c
+++ b/src/execute.c
@@ -1038,6 +1038,11 @@ int exec_spawn(ExecCommand *command,
goto fail;
}
+ /* If a socket is connected to STDIN/STDOUT/STDERR, we
+ * must sure to drop O_NONBLOCK */
+ if (socket_fd >= 0)
+ fd_nonblock(socket_fd, false);
+
if (!keep_stdin)
if (setup_input(context, socket_fd, apply_tty_stdin) < 0) {
r = EXIT_STDIN;