set all the child file descriptors to non-blocking so that we don't hang if the child fails to send a newline-terminated command or error message

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@7435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.2-netsec
Kevin P. Fleming 20 years ago
parent ef09c506c8
commit 86bb1472cc

@ -345,8 +345,6 @@ static int app_exec(struct ast_channel *chan, void *data)
goto exit;
}
setvbuf(child_events, NULL, _IONBF, 0);
if (!(child_commands = fdopen(child_commands_fd, "r"))) {
ast_chan_log(LOG_WARNING, chan, "Could not open stream for child commands\n");
goto exit;
@ -357,6 +355,10 @@ static int app_exec(struct ast_channel *chan, void *data)
goto exit;
}
setvbuf(child_events, NULL, _IONBF, 0);
setvbuf(child_commands, NULL, _IONBF, 0);
setvbuf(child_errors, NULL, _IONBF, 0);
res = 0;
while (1) {

Loading…
Cancel
Save