From: Mark Spencer Date: Tue, 24 Oct 2006 20:30:25 +0000 (+0000) Subject: Fix FastAGI when there is no pid (bug #7628, #8147) X-Git-Tag: 1.4.0-beta4~284 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=72a23ce184cc79430aad5d5a491635f521b5ecfd;p=thirdparty%2Fasterisk.git Fix FastAGI when there is no pid (bug #7628, #8147) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@46142 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_agi.c b/res/res_agi.c index 736cea3944..de9fd31512 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -1868,7 +1868,8 @@ static enum agi_result run_agi(struct ast_channel *chan, char *request, AGI *agi returnstatus = -1; if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "AGI Script %s completed, returning %d\n", request, returnstatus); - waitpid(pid, status, 0); + if (pid > 0) + waitpid(pid, status, 0); /* No need to kill the pid anymore, since they closed us */ pid = -1; break;