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) {