aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/res_agi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/res/res_agi.c b/res/res_agi.c
index bf51946f9..edcda4e60 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -2023,7 +2023,8 @@ static int agi_exec_full(struct ast_channel *chan, void *data, int enhanced, int
/* If the fork'd process returns non-zero, set AGISTATUS to FAILURE */
if (res == AGI_RESULT_SUCCESS && status)
res = AGI_RESULT_FAILURE;
- close(fds[1]);
+ if (fds[1] != fds[0])
+ close(fds[1]);
if (efd > -1)
close(efd);
ast_unreplace_sigchld();