fix issue where file isn't in database and move zstr check into switch_file_exists

This commit is contained in:
Brian West
2010-05-06 16:25:23 -05:00
parent ef18989d56
commit f254787c02
2 changed files with 12 additions and 8 deletions
+7 -5
View File
@@ -507,15 +507,17 @@ SWITCH_DECLARE(switch_status_t) switch_file_exists(const char *filename, switch_
switch_status_t status = SWITCH_STATUS_FALSE;
apr_finfo_t info = { 0 };
if (zstr(filename)) {
return status;
}
if (!pool) {
switch_core_new_memory_pool(&our_pool);
}
if (filename) {
apr_stat(&info, filename, wanted, pool ? pool : our_pool);
if (info.filetype != APR_NOFILE) {
status = SWITCH_STATUS_SUCCESS;
}
apr_stat(&info, filename, wanted, pool ? pool : our_pool);
if (info.filetype != APR_NOFILE) {
status = SWITCH_STATUS_SUCCESS;
}
if (our_pool) {