Fix returned error type
[platform/core/api/media-content.git] / src / media_util_private.c
index 05e6415..fd37b7e 100755 (executable)
@@ -98,7 +98,10 @@ int _media_util_check_ignore_dir(const char *dir_path, bool *ignore)
                        *ignore = TRUE;
                        media_content_error("Open Directory fail");
                        media_content_sec_debug("Open fail path[%s]", search_path);
-                       return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+                       if (errno == EACCES || errno == EPERM)
+                               return MEDIA_CONTENT_ERROR_PERMISSION_DENIED;
+                       else
+                               return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
                }
 
                media_content_retvm_if(dp == NULL, MEDIA_CONTENT_ERROR_INVALID_OPERATION, "Open Directory fail");