diff options
author | Joshua Colp <jcolp@digium.com> | 2007-06-22 16:19:53 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2007-06-22 16:19:53 +0000 |
commit | c00428b0b02444fd9c20d0441ce384eeb9fa3e4c (patch) | |
tree | e564f390dbde5d0e81bcba3fb91b379b7a2baecd /res | |
parent | 6f986656720c2a8bc772c7422583ff742dd54cd9 (diff) |
Use stat to determine whether the file exists or not. (issue #10038 reported by Mike Anikienko)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@71158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r-- | res/res_agi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/res/res_agi.c b/res/res_agi.c index dc4bbd7f7..fee2e231c 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -242,7 +242,8 @@ static enum agi_result launch_script(char *script, char *argv[], int *fds, int * int x; int res; sigset_t signal_set, old_set; - + struct stat st; + if (!strncasecmp(script, "agi://", 6)) return launch_netscript(script, argv, fds, efd, opid); @@ -252,7 +253,7 @@ static enum agi_result launch_script(char *script, char *argv[], int *fds, int * } /* Before even trying let's see if the file actually exists */ - if (!ast_fileexists(script, NULL, NULL)) { + if (stat(script, &st)) { ast_log(LOG_WARNING, "Failed to execute '%s': File does not exist.\n", script); return AGI_RESULT_NOTFOUND; } |