exec: make sure O_NONBLOCK is off for all sockets passed as STDIN/STDOUT/STDERR

This commit is contained in:
Lennart Poettering
2010-08-30 23:31:27 +02:00
parent 2528a7a62c
commit da726a4d4d
2 changed files with 19 additions and 10 deletions
+5
View File
@@ -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;