Fix improper errno handling 84/195984/1 accepted/tizen/unified/20181221.054409 submit/tizen/20181220.092910 submit/tizen/20181220.105657
authorSeungbae Shin <seungbae.shin@samsung.com>
Thu, 20 Dec 2018 09:21:31 +0000 (18:21 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Thu, 20 Dec 2018 09:22:32 +0000 (18:22 +0900)
[Version] 0.0.16
[Issue Type] Bug

Change-Id: Ic68d6669db32d49f79b5debd70a8d9c2e7de241c

packaging/capi-media-sound-pool.spec
src/source.c

index 3b72a4120e0ea0adc4b8ddcd43f5561a7f28c31d..a27c73b7161e527b71d0a8b7973a670986af9a6c 100644 (file)
@@ -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
index 83f2fcd418296e33b5f5603ef54b5b2e55c73529..37b705f9b2a4732e9288104e967d96bd2f94787a 100644 (file)
@@ -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;
        }