[asterisk-commits] branch 1.2 r24019 - in /branches/1.2: ./ apps/ include/asterisk/ res/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon May 1 13:44:25 MST 2006


Author: tilghman
Date: Mon May  1 15:44:24 2006
New Revision: 24019

URL: http://svn.digium.com/view/asterisk?rev=24019&view=rev
Log:
Bug 6864 - drop realtime priority on ALL external processes

Modified:
    branches/1.2/apps/app_externalivr.c
    branches/1.2/apps/app_festival.c
    branches/1.2/apps/app_ices.c
    branches/1.2/apps/app_mp3.c
    branches/1.2/apps/app_nbscat.c
    branches/1.2/apps/app_zapras.c
    branches/1.2/asterisk.c
    branches/1.2/include/asterisk/options.h
    branches/1.2/res/res_musiconhold.c

Modified: branches/1.2/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/apps/app_externalivr.c?rev=24019&r1=24018&r2=24019&view=diff
==============================================================================
--- branches/1.2/apps/app_externalivr.c (original)
+++ branches/1.2/apps/app_externalivr.c Mon May  1 15:44:24 2006
@@ -44,6 +44,7 @@
 #include "asterisk/module.h"
 #include "asterisk/linkedlists.h"
 #include "asterisk/app.h"
+#include "asterisk/options.h"
 
 static const char *tdesc = "External IVR Interface Application";
 
@@ -312,6 +313,9 @@
 	if (!pid) {
 		/* child process */
 		int i;
+
+		if (option_highpriority)
+			ast_set_priority(0);
 
 		dup2(child_stdin[0], STDIN_FILENO);
 		dup2(child_stdout[1], STDOUT_FILENO);

Modified: branches/1.2/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/apps/app_festival.c?rev=24019&r1=24018&r2=24019&view=diff
==============================================================================
--- branches/1.2/apps/app_festival.c (original)
+++ branches/1.2/apps/app_festival.c Mon May  1 15:44:24 2006
@@ -53,6 +53,7 @@
 #include "asterisk/config.h"
 #include "asterisk/utils.h"
 #include "asterisk/lock.h"
+#include "asterisk/options.h"
 
 #define FESTIVAL_CONFIG "festival.conf"
 
@@ -136,6 +137,9 @@
                 if (x != fd)
                         close(x);
         }
+	if (option_highpriority)
+		ast_set_priority(0);
+
 /*IAS */
 #ifdef __PPC__  
 	for( x=0; x<length; x+=2)

Modified: branches/1.2/apps/app_ices.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/apps/app_ices.c?rev=24019&r1=24018&r2=24019&view=diff
==============================================================================
--- branches/1.2/apps/app_ices.c (original)
+++ branches/1.2/apps/app_ices.c Mon May  1 15:44:24 2006
@@ -44,6 +44,7 @@
 #include "asterisk/pbx.h"
 #include "asterisk/module.h"
 #include "asterisk/translate.h"
+#include "asterisk/options.h"
 
 #define ICES "/usr/bin/ices"
 #define LOCAL_ICES "/usr/local/bin/ices"
@@ -72,6 +73,8 @@
 		ast_log(LOG_WARNING, "Fork failed\n");
 	if (res)
 		return res;
+	if (option_highpriority)
+		ast_set_priority(0);
 	dup2(fd, STDIN_FILENO);
 	for (x=STDERR_FILENO + 1;x<256;x++) {
 		if ((x != STDIN_FILENO) && (x != STDOUT_FILENO))

Modified: branches/1.2/apps/app_mp3.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/apps/app_mp3.c?rev=24019&r1=24018&r2=24019&view=diff
==============================================================================
--- branches/1.2/apps/app_mp3.c (original)
+++ branches/1.2/apps/app_mp3.c Mon May  1 15:44:24 2006
@@ -43,6 +43,7 @@
 #include "asterisk/pbx.h"
 #include "asterisk/module.h"
 #include "asterisk/translate.h"
+#include "asterisk/options.h"
 
 #define LOCAL_MPG_123 "/usr/local/bin/mpg123"
 #define MPG_123 "/usr/bin/mpg123"
@@ -71,6 +72,8 @@
 		ast_log(LOG_WARNING, "Fork failed\n");
 	if (res)
 		return res;
+	if (option_highpriority)
+		ast_set_priority(0);
 	dup2(fd, STDOUT_FILENO);
 	for (x=0;x<256;x++) {
 		if (x != STDOUT_FILENO)

Modified: branches/1.2/apps/app_nbscat.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/apps/app_nbscat.c?rev=24019&r1=24018&r2=24019&view=diff
==============================================================================
--- branches/1.2/apps/app_nbscat.c (original)
+++ branches/1.2/apps/app_nbscat.c Mon May  1 15:44:24 2006
@@ -44,6 +44,7 @@
 #include "asterisk/pbx.h"
 #include "asterisk/module.h"
 #include "asterisk/translate.h"
+#include "asterisk/options.h"
 
 #define LOCAL_NBSCAT "/usr/local/bin/nbscat8k"
 #define NBSCAT "/usr/bin/nbscat8k"
@@ -75,6 +76,9 @@
 		ast_log(LOG_WARNING, "Fork failed\n");
 	if (res)
 		return res;
+	if (option_highpriority)
+		ast_set_priority(0);
+
 	dup2(fd, STDOUT_FILENO);
 	for (x=0;x<256;x++) {
 		if (x != STDOUT_FILENO)

Modified: branches/1.2/apps/app_zapras.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/apps/app_zapras.c?rev=24019&r1=24018&r2=24019&view=diff
==============================================================================
--- branches/1.2/apps/app_zapras.c (original)
+++ branches/1.2/apps/app_zapras.c Mon May  1 15:44:24 2006
@@ -95,6 +95,10 @@
 
 	/* Execute RAS on File handles */
 	dup2(chan->fds[0], STDIN_FILENO);
+
+	/* Drop high priority */
+	if (option_highpriority)
+		ast_set_priority(0);
 
 	/* Close other file descriptors */
 	for (x=STDERR_FILENO + 1;x<1024;x++) 

Modified: branches/1.2/asterisk.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/asterisk.c?rev=24019&r1=24018&r2=24019&view=diff
==============================================================================
--- branches/1.2/asterisk.c (original)
+++ branches/1.2/asterisk.c Mon May  1 15:44:24 2006
@@ -443,6 +443,8 @@
 	pid = fork();
 
 	if (pid == 0) {
+		if (option_highpriority)
+			ast_set_priority(0);
 		/* Close file descriptors and launch system command */
 		for (x = STDERR_FILENO + 1; x < 4096; x++)
 			close(x);

Modified: branches/1.2/include/asterisk/options.h
URL: http://svn.digium.com/view/asterisk/branches/1.2/include/asterisk/options.h?rev=24019&r1=24018&r2=24019&view=diff
==============================================================================
--- branches/1.2/include/asterisk/options.h (original)
+++ branches/1.2/include/asterisk/options.h Mon May  1 15:44:24 2006
@@ -44,6 +44,7 @@
 extern int option_transcode_slin;
 extern int option_transmit_silence_during_record;
 extern int option_maxcalls;
+extern int option_highpriority;
 extern double option_maxload;
 extern int option_dontwarn;
 extern int option_priority_jumping;

Modified: branches/1.2/res/res_musiconhold.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/res/res_musiconhold.c?rev=24019&r1=24018&r2=24019&view=diff
==============================================================================
--- branches/1.2/res/res_musiconhold.c (original)
+++ branches/1.2/res/res_musiconhold.c Mon May  1 15:44:24 2006
@@ -440,6 +440,10 @@
 	}
 	if (!class->pid) {
 		int x;
+
+		if (option_highpriority)
+			ast_set_priority(0);
+
 		close(fds[0]);
 		/* Stdout goes to pipe */
 		dup2(fds[1], STDOUT_FILENO);



More information about the asterisk-commits mailing list