aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_externalivr.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-21 13:39:41 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-21 13:39:41 +0000
commit20baa655f7ffdabf2a74d53d8019b1ceb6be88f5 (patch)
tree99e8c1c82227cef01eeab3ccdbd380801188377a /apps/app_externalivr.c
parent137f90f7b98e60c25c9614be8177c58b175ccdb2 (diff)
On socket-based connections, there is no error FD, so don't try waiting on one.
(closes issue #12697) Reported by: ctooley Patches: fix_externalivr_waitfor_nandfds-v3.diff uploaded by ctooley (license 136) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@117431 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_externalivr.c')
-rw-r--r--apps/app_externalivr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/app_externalivr.c b/apps/app_externalivr.c
index 6068e5f48..8dbc53e76 100644
--- a/apps/app_externalivr.c
+++ b/apps/app_externalivr.c
@@ -379,7 +379,7 @@ static int app_exec(struct ast_channel *chan, void *data)
if (!ser) {
goto exit;
}
- res = eivr_comm(chan, u, ser->fd, ser->fd, 0, pipe_delim_argbuf);
+ res = eivr_comm(chan, u, ser->fd, ser->fd, -1, pipe_delim_argbuf);
} else {
if (pipe(child_stdin)) {
@@ -495,7 +495,7 @@ static int eivr_comm(struct ast_channel *chan, struct ivr_localuser *u,
ast_chan_log(LOG_WARNING, chan, "Could not open stream to receive commands\n");
goto exit;
}
- if(eivr_errors_fd) { /* if opening a socket connection, error stream will not be used */
+ if (eivr_errors_fd > -1) { /* if opening a socket connection, error stream will not be used */
if (!(eivr_errors = fdopen(eivr_errors_fd, "r"))) {
ast_chan_log(LOG_WARNING, chan, "Could not open stream to receive errors\n");
goto exit;
@@ -529,7 +529,7 @@ static int eivr_comm(struct ast_channel *chan, struct ivr_localuser *u,
errno = 0;
exception = 0;
- rchan = ast_waitfor_nandfds(&chan, 1, waitfds, 2, &exception, &ready_fd, &ms);
+ rchan = ast_waitfor_nandfds(&chan, 1, waitfds, (eivr_errors_fd < 0) ? 1 : 2, &exception, &ready_fd, &ms);
if (!AST_LIST_EMPTY(&u->finishlist)) {
AST_LIST_LOCK(&u->finishlist);