Fix log position to avoid errno change. (errno can be changed when using dlog) 72/197072/2
authorMinje Ahn <minje.ahn@samsung.com>
Wed, 9 Jan 2019 08:32:03 +0000 (17:32 +0900)
committerhj kim <backto.kim@samsung.com>
Wed, 9 Jan 2019 08:38:57 +0000 (17:38 +0900)
Change-Id: Ie8aac74cc9c9a2d47ac77905ed49bddcc717f113
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
src/media_util_private.c

index 1415b4f..d27bbb1 100755 (executable)
@@ -300,13 +300,15 @@ int _media_content_check_dir(const char *path)
 #endif
        dp = opendir(path);
        if (dp == NULL) {
-               media_content_sec_error("path [%s]", path);
-               media_content_stderror("open dir fail");
-
-               if (errno == EACCES || errno == EPERM)
+               if (errno == EACCES || errno == EPERM) {
+                       media_content_stderror("open dir fail");
+                       media_content_sec_error("path [%s]", path);
                        return MEDIA_CONTENT_ERROR_PERMISSION_DENIED;
-               else
+               } else {
+                       media_content_stderror("open dir fail");
+                       media_content_sec_error("path [%s]", path);
                        return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+               }
        }
 
        closedir(dp);