[svn-commits] russell: branch 1.6.0 r165663 - in /branches/1.6.0: ./ res/res_musiconhold.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Dec 18 12:56:33 CST 2008


Author: russell
Date: Thu Dec 18 12:56:32 2008
New Revision: 165663

URL: http://svn.digium.com/view/asterisk?view=rev&rev=165663
Log:
Merged revisions 165662 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r165662 | russell | 2008-12-18 12:54:47 -0600 (Thu, 18 Dec 2008) | 15 lines

Merged revisions 165661 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r165661 | russell | 2008-12-18 12:52:18 -0600 (Thu, 18 Dec 2008) | 7 lines

Set the process group ID on the MOH process so that all children will get killed

(closes issue #14099)
Reported by: caspy
Patches:
      res_musiconhold.c.patch.killpg.try2 uploaded by caspy (license 645)

........

................

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/res/res_musiconhold.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/res/res_musiconhold.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/res/res_musiconhold.c?view=diff&rev=165663&r1=165662&r2=165663
==============================================================================
--- branches/1.6.0/res/res_musiconhold.c (original)
+++ branches/1.6.0/res/res_musiconhold.c Thu Dec 18 12:56:32 2008
@@ -527,6 +527,7 @@
 			ast_log(LOG_WARNING, "chdir() failed: %s\n", strerror(errno));
 			_exit(1);
 		}
+		setpgid(0, getpid());
 		if (ast_test_flag(class, MOH_CUSTOM)) {
 			execv(argv[0], argv);
 		} else {
@@ -608,11 +609,11 @@
 				class->srcfd = -1;
 				pthread_testcancel();
 				if (class->pid > 1) {
-					kill(class->pid, SIGHUP);
+					killpg(class->pid, SIGHUP);
 					usleep(100000);
-					kill(class->pid, SIGTERM);
+					killpg(class->pid, SIGTERM);
 					usleep(100000);
-					kill(class->pid, SIGKILL);
+					killpg(class->pid, SIGKILL);
 					class->pid = 0;
 				}
 			} else {
@@ -1454,11 +1455,11 @@
 			/* Back when this was just mpg123, SIGKILL was fine.  Now we need
 			 * to give the process a reason and time enough to kill off its
 			 * children. */
-			kill(pid, SIGHUP);
+			killpg(pid, SIGHUP);
 			usleep(100000);
-			kill(pid, SIGTERM);
+			killpg(pid, SIGTERM);
 			usleep(100000);
-			kill(pid, SIGKILL);
+			killpg(pid, SIGKILL);
 			while ((ast_wait_for_input(moh->srcfd, 100) > 0) && (bytes = read(moh->srcfd, buff, 8192)) && time(NULL) < stime)
 				tbytes = tbytes + bytes;
 			ast_debug(1, "mpg123 pid %d and child died after %d bytes read\n", pid, tbytes);




More information about the svn-commits mailing list