From: Tilghman Lesher Date: Mon, 12 Jun 2006 15:27:18 +0000 (+0000) Subject: Move set priority up, because at this point in the code, stdout is no longer X-Git-Tag: 1.2.10~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=070d4d39769726bb3cc52030c562628008b33b56;p=thirdparty%2Fasterisk.git Move set priority up, because at this point in the code, stdout is no longer the console. If we're unable to set priority, the error goes to Asterisk as if it were an AGI command (issue 7335). git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@33615 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_agi.c b/res/res_agi.c index ddfabb3574..5d2a029e19 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -282,6 +282,9 @@ static int launch_script(char *script, char *argv[], int *fds, int *efd, int *op return -1; } if (!pid) { + /* Don't run AGI scripts with realtime priority -- it causes audio stutter */ + ast_set_priority(0); + /* Redirect stdin and out, provide enhanced audio channel if desired */ dup2(fromast[0], STDIN_FILENO); dup2(toast[1], STDOUT_FILENO); @@ -301,9 +304,6 @@ static int launch_script(char *script, char *argv[], int *fds, int *efd, int *op for (x=STDERR_FILENO + 2;x<1024;x++) close(x); - /* Don't run AGI scripts with realtime priority -- it causes audio stutter */ - ast_set_priority(0); - /* Execute script */ execv(script, argv); /* Can't use ast_log since FD's are closed */