From: Hyunil Date: Thu, 20 Dec 2018 07:50:38 +0000 (+0900) Subject: Avoid changing errnum of strerror_r by dlog X-Git-Tag: submit/tizen_5.0/20181224.063657^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_5.0_unified;p=platform%2Fcore%2Fapi%2Fmediastreamer.git Avoid changing errnum of strerror_r by dlog Change-Id: Iec86bc156b2dbb701d4ebcab38dc0e2727f579c7 Signed-off-by: Hyunil (cherry picked from commit 0acd1426fd5cb2e03a04a29664beb4a2e0bb9c56) --- diff --git a/src/media_streamer_util.c b/src/media_streamer_util.c index 7b62507..147b160 100644 --- a/src/media_streamer_util.c +++ b/src/media_streamer_util.c @@ -354,6 +354,8 @@ int __ms_util_uri_path_check(const char *file_uri) { struct stat stat_results = {0, }; int file_open = 0; + char mes_error[256]; + int errnum = 0; ms_debug_fenter(); @@ -362,11 +364,11 @@ int __ms_util_uri_path_check(const char *file_uri) file_open = open(file_uri, O_RDONLY); if (file_open < 0) { - char mes_error[256]; - strerror_r(errno, mes_error, sizeof(mes_error)); - ms_error("Couldn`t open file [%s] according to [%s]. Error N [%d]", file_uri, mes_error, errno); + errnum = errno; + strerror_r(errnum, mes_error, sizeof(mes_error)); + ms_error("Couldn`t open file [%s] according to [%s]. Error N [%d]", file_uri, mes_error, errnum); - if (EACCES == errno) + if (EACCES == errnum) return MEDIA_STREAMER_ERROR_PERMISSION_DENIED; return MEDIA_STREAMER_ERROR_INVALID_PARAMETER;