From: Seungbae Shin Date: Thu, 20 Dec 2018 09:21:31 +0000 (+0900) Subject: Fix improper errno handling X-Git-Tag: submit/tizen/20181220.092910^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=598714947d4df4bc23443d18b7580fed80c8037f;p=platform%2Fcore%2Fapi%2Fsound-pool.git Fix improper errno handling [Version] 0.0.16 [Issue Type] Bug Change-Id: Ic68d6669db32d49f79b5debd70a8d9c2e7de241c --- diff --git a/packaging/capi-media-sound-pool.spec b/packaging/capi-media-sound-pool.spec index 3b72a41..a27c73b 100644 --- a/packaging/capi-media-sound-pool.spec +++ b/packaging/capi-media-sound-pool.spec @@ -1,5 +1,5 @@ Name: capi-media-sound-pool -Version: 0.0.15 +Version: 0.0.16 Summary: Tizen Sound Pool module Release: 0 Group: Multimedia/Framework diff --git a/src/source.c b/src/source.c index 83f2fcd..37b705f 100644 --- a/src/source.c +++ b/src/source.c @@ -101,14 +101,15 @@ static sound_pool_error_e __probe_file_access(const char *file, int amode) if (-1 == access(file, amode)) { char errmsg[256]; - strerror_r(errno, errmsg, sizeof(errmsg)); - SP_ERROR("Couldn`t open file in [%i] mode, reason [%s].", amode, errmsg); if (EACCES == errno) ret = SOUND_POOL_ERROR_NOT_PERMITTED; else if (ENOENT == errno) ret = SOUND_POOL_ERROR_NO_SUCH_FILE; else ret = SOUND_POOL_ERROR_INVALID_OPERATION; + strerror_r(errno, errmsg, sizeof(errmsg)); + SP_ERROR("Couldn`t open file in [%i] mode, reason [%s].", amode, errmsg); + SP_DEBUG_FLEAVE(); return ret; }