mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-19 08:11:21 +00:00
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
This commit is contained in:
@@ -345,8 +345,6 @@ static int app_exec(struct ast_channel *chan, void *data)
|
|||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
setvbuf(child_events, NULL, _IONBF, 0);
|
|
||||||
|
|
||||||
if (!(child_commands = fdopen(child_commands_fd, "r"))) {
|
if (!(child_commands = fdopen(child_commands_fd, "r"))) {
|
||||||
ast_chan_log(LOG_WARNING, chan, "Could not open stream for child commands\n");
|
ast_chan_log(LOG_WARNING, chan, "Could not open stream for child commands\n");
|
||||||
goto exit;
|
goto exit;
|
||||||
@@ -357,6 +355,10 @@ static int app_exec(struct ast_channel *chan, void *data)
|
|||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setvbuf(child_events, NULL, _IONBF, 0);
|
||||||
|
setvbuf(child_commands, NULL, _IONBF, 0);
|
||||||
|
setvbuf(child_errors, NULL, _IONBF, 0);
|
||||||
|
|
||||||
res = 0;
|
res = 0;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user