diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-12-12 17:30:59 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-12-12 17:30:59 +0000 |
commit | 7b67d7de0cc894dc5e3b127e7e62c0e9b4aaa29f (patch) | |
tree | 6ecfcd987a22d46077228e3831734716219eb04f /apps | |
parent | 12c02f4963dbcc3c189a02d91d5ba5a261ccc70c (diff) |
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: http://svn.digium.com/svn/asterisk/branches/1.2@7435 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_externalivr.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/app_externalivr.c b/apps/app_externalivr.c index 54b730b65..ad27c1659 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) { |