Merged revisions 178342 via svnmerge from

https://origsvn.digium.com/svn/asterisk/trunk

........
  r178342 | tilghman | 2009-02-24 14:06:48 -0600 (Tue, 24 Feb 2009) | 2 lines
  
  Use a SIGPIPE to kill the process, instead of depending upon the astcanary process being inherited by init.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@178344 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2009-02-24 20:08:19 +00:00
parent 702168f0a8
commit 72d9485e7c
2 changed files with 19 additions and 3 deletions

View File

@@ -89,7 +89,7 @@ int main(int argc, char *argv[])
int fd;
/* Run at normal priority */
setpriority(PRIO_PROCESS, 0, 0);
for (; getppid() != 1;) {
for (;;) {
/* Update the modification times (checked from Asterisk) */
if (utime(argv[1], NULL)) {
/* Recreate the file if it doesn't exist */
@@ -108,7 +108,7 @@ int main(int argc, char *argv[])
sleep(5);
}
/* Reached if asterisk (our parent process) dies - its chldren are inherited by the init process (pid is 1). */
/* Never reached */
return 0;
}