]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Don't close the second file descriptor if it's the same as the first one, as it will...
authorJoshua Colp <jcolp@digium.com>
Wed, 6 Sep 2006 20:02:59 +0000 (20:02 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 6 Sep 2006 20:02:59 +0000 (20:02 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@42148 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_agi.c

index e9b275ed0b8e2b7a9d7d605315ccfbdfe033df1a..de4c7be39378527281c0f2b146a5c12e87583e12 100644 (file)
@@ -2047,7 +2047,8 @@ static int agi_exec_full(struct ast_channel *chan, void *data, int enhanced, int
                agi.ctrl = fds[0];
                agi.audio = efd;
                res = run_agi(chan, argv[0], &agi, pid, dead);
-               close(fds[1]);
+               if (fds[1] != fds[0])
+                       close(fds[1]);
                if (efd > -1)
                        close(efd);
        }