Pass the PID of the Asterisk process, not the PID of the canary.
authorTilghman Lesher <tilghman@meg.abyt.es>
Fri, 2 Apr 2010 20:19:01 +0000 (20:19 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Fri, 2 Apr 2010 20:19:01 +0000 (20:19 +0000)
(closes issue #17065)
 Reported by: globalnetinc
 Patches:
       astcanary.patch uploaded by makoto (license 38)
 Tested by: frawd, globalnetinc

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@255952 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/asterisk.c

index 93d52c0..8f557f7 100644 (file)
@@ -3530,7 +3530,7 @@ int main(int argc, char *argv[])
 
                        ast_close_fds_above_n(0);
                        ast_set_priority(0);
-                       snprintf(ppid, sizeof(ppid), "%d", (int) getpid());
+                       snprintf(ppid, sizeof(ppid), "%d", (int) ast_mainpid);
 
                        execlp("astcanary", "astcanary", canary_filename, ppid, (char *)NULL);