]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
media_cache: Prefer ast_file_is_readable() over access()
authorSean Bright <sean.bright@gmail.com>
Wed, 8 Mar 2017 23:08:52 +0000 (18:08 -0500)
committerSean Bright <sean.bright@gmail.com>
Wed, 8 Mar 2017 23:08:52 +0000 (18:08 -0500)
Change-Id: Icc0dc6e61b2e68d5cdcb74b016b2726a388c7def

main/media_cache.c

index 4d1cf546a6613332552c9e312a2dc44990c95e95..e92cce53a2933d55992945fe6238978febebc979 100644 (file)
@@ -227,7 +227,7 @@ int ast_media_cache_retrieve(const char *uri, const char *preferred_file_name,
        bucket_file = ao2_find(media_cache, uri, OBJ_SEARCH_KEY | OBJ_NOLOCK);
        if (bucket_file) {
                if (!ast_bucket_file_is_stale(bucket_file)
-                       && !access(bucket_file->path, R_OK)) {
+                       && ast_file_is_readable(bucket_file->path)) {
                        ast_copy_string(file_path, bucket_file->path, len);
                        if ((ext = strrchr(file_path, '.'))) {
                                *ext = '\0';