From 86bb1472ccdb7777bd6a10a9022d67ad2110b406 Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Mon, 12 Dec 2005 17:30:59 +0000 Subject: [PATCH] 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 --- apps/app_externalivr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/app_externalivr.c b/apps/app_externalivr.c index 54b730b656..ad27c16599 100644 --- a/apps/app_externalivr.c +++ b/apps/app_externalivr.c @@ -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) {