[asterisk-commits] media cache: Prefer ast file is readable() over access() (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Mar 9 16:10:25 CST 2017


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/5148 )

Change subject: media_cache: Prefer ast_file_is_readable() over access()
......................................................................


media_cache: Prefer ast_file_is_readable() over access()

Change-Id: Icc0dc6e61b2e68d5cdcb74b016b2726a388c7def
---
M main/media_cache.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Mark Michelson: Looks good to me, but someone else must approve
  Richard Mudgett: Looks good to me, approved
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, but someone else must approve



diff --git a/main/media_cache.c b/main/media_cache.c
index 2592f35..c58acdd 100644
--- a/main/media_cache.c
+++ b/main/media_cache.c
@@ -225,7 +225,7 @@
 	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';

-- 
To view, visit https://gerrit.asterisk.org/5148
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Icc0dc6e61b2e68d5cdcb74b016b2726a388c7def
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-commits mailing list