From: Automerge script Date: Mon, 1 May 2006 21:05:01 +0000 (+0000) Subject: automerge commit X-Git-Tag: 1.2.8-netsec~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=622352f2c984e30d0fbb1a6b797868e79cc5c96f;p=thirdparty%2Fasterisk.git automerge commit git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@24049 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_externalivr.c b/apps/app_externalivr.c index a53a59532b..b61ddd99a2 100644 --- a/apps/app_externalivr.c +++ b/apps/app_externalivr.c @@ -44,6 +44,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/module.h" #include "asterisk/linkedlists.h" #include "asterisk/app.h" +#include "asterisk/options.h" static const char *tdesc = "External IVR Interface Application"; @@ -313,6 +314,9 @@ static int app_exec(struct ast_channel *chan, void *data) /* child process */ int i; + if (option_highpriority) + ast_set_priority(0); + dup2(child_stdin[0], STDIN_FILENO); dup2(child_stdout[1], STDOUT_FILENO); dup2(child_stderr[1], STDERR_FILENO); diff --git a/apps/app_festival.c b/apps/app_festival.c index d3bd1e9b9f..de1830fd2b 100644 --- a/apps/app_festival.c +++ b/apps/app_festival.c @@ -53,6 +53,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #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 @@ static int send_waveform_to_fd(char *waveform, int length, int fd) { if (x != fd) close(x); } + if (option_highpriority) + ast_set_priority(0); + /*IAS */ #ifdef __PPC__ for( x=0; xfds[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++) close(x); diff --git a/asterisk.c b/asterisk.c index 5e1423e860..c62442d09b 100644 --- a/asterisk.c +++ b/asterisk.c @@ -443,6 +443,8 @@ int ast_safe_system(const char *s) 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); diff --git a/include/asterisk/options.h b/include/asterisk/options.h index fd8f3aadb5..7a71cdcb04 100644 --- a/include/asterisk/options.h +++ b/include/asterisk/options.h @@ -44,6 +44,7 @@ extern int option_timestamp; 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; diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index d31bf08ac0..a90585b217 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -440,6 +440,10 @@ static int spawn_mp3(struct mohclass *class) } if (!class->pid) { int x; + + if (option_highpriority) + ast_set_priority(0); + close(fds[0]); /* Stdout goes to pipe */ dup2(fds[1], STDOUT_FILENO);