From 888e2b6f00d850271ae3ac25e7fff69bd81dc7ce Mon Sep 17 00:00:00 2001 From: "jiyong.min" Date: Thu, 10 Jan 2019 08:03:43 +0900 Subject: [PATCH] Fix the log position to avoid errno change. (errno can be changed when using dlog) Change-Id: I4a81986414f8a5b5dc252b888c19410bc324b1a1 --- src/media_util_private.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/media_util_private.c b/src/media_util_private.c index d27bbb1..65b7a1a 100755 --- a/src/media_util_private.c +++ b/src/media_util_private.c @@ -64,12 +64,15 @@ int _media_util_check_file_exist(const char *path) /* check the file exits actually */ exist = open(path, O_RDONLY); if (exist < 0) { - media_content_sec_debug("path [%s]", path); - media_content_stderror("open file fail"); - if (errno == EACCES || errno == EPERM) + if (errno == EACCES || errno == EPERM) { + media_content_stderror("open file fail"); + media_content_sec_debug("path [%s]", path); return MEDIA_CONTENT_ERROR_PERMISSION_DENIED; - else + } else { + media_content_stderror("open file fail"); + media_content_sec_debug("path [%s]", path); return MEDIA_CONTENT_ERROR_INVALID_PARAMETER; + } } close(exist); -- 2.7.4