Change value name 84/46884/2 accepted/tizen/mobile/20150828.083027 accepted/tizen/tv/20150828.083048 accepted/tizen/wearable/20150828.083055 submit/tizen/20150828.015755
authorMinje Ahn <minje.ahn@samsung.com>
Thu, 27 Aug 2015 02:06:56 +0000 (11:06 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Thu, 27 Aug 2015 02:36:11 +0000 (11:36 +0900)
Change-Id: Ic43c53418c5379825f481835ce59ec55ccf09a13
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
lib/include/media-util-db.h
lib/media-util-cynara.c
lib/media-util-db.c

index eeb720f..f0f807a 100755 (executable)
@@ -30,7 +30,7 @@ extern "C" {
 
 typedef void MediaDBHandle;            /**< Handle */
 
-int media_db_connect(MediaDBHandle **handle, uid_t uid, bool needWrite);
+int media_db_connect(MediaDBHandle **handle, uid_t uid, bool need_write);
 
 int media_db_disconnect(MediaDBHandle *handle);
 
index 5b5e1dc..5c75c0b 100644 (file)
@@ -259,7 +259,7 @@ int ms_cynara_check(const ms_peer_credentials *creds, const char *privilege)
        result = cynara_check(_cynara, creds->smack, session, creds->uid, privilege);
        G_UNLOCK(cynara_mutex);
 
-       if (result < 0)
+       if (result != CYNARA_API_ACCESS_ALLOWED)
                ms_cynara_dbg_err("cynara_check", result);
 
        MS_SAFE_FREE(session);
@@ -269,16 +269,16 @@ int ms_cynara_check(const ms_peer_credentials *creds, const char *privilege)
 int ms_cynara_enable_credentials_passing(int fd)
 {
        const int optval = 1;
-       int r;
+       int err;
 
-       r = setsockopt(fd, SOL_SOCKET, SO_PASSSEC, &optval, sizeof(optval));
-       if (r != 0) {
+       err = setsockopt(fd, SOL_SOCKET, SO_PASSSEC, &optval, sizeof(optval));
+       if (err != 0) {
                MSAPI_DBG_ERR("Failed to set SO_PASSSEC socket option");
                return MS_MEDIA_ERR_SOCKET_INTERNAL;
        }
 
-       r = setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &optval, sizeof(optval));
-       if (r != 0) {
+       err = setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &optval, sizeof(optval));
+       if (err != 0) {
                MSAPI_DBG_ERR("Failed to set SO_PASSCRED socket option");
                return MS_MEDIA_ERR_SOCKET_INTERNAL;
        }
index 075bb69..d8cdbad 100755 (executable)
@@ -40,7 +40,7 @@ static __thread char **sql_list = NULL;
 static __thread int g_list_idx = 0;
 
 static int __media_db_busy_handler(void *pData, int count);
-static int __media_db_connect_db_with_handle(sqlite3 **db_handle, uid_t uid, bool needWrite);
+static int __media_db_connect_db_with_handle(sqlite3 **db_handle, uid_t uid, bool need_write);
 static int __media_db_disconnect_db_with_handle(sqlite3 *db_handle);
 
 static void __media_db_destroy_sql_list()
@@ -100,12 +100,12 @@ static char* __media_get_media_DB(uid_t uid)
        return result_psswd;
 }
 
-static int __media_db_connect_db_with_handle(sqlite3 **db_handle,uid_t uid, bool needWrite)
+static int __media_db_connect_db_with_handle(sqlite3 **db_handle,uid_t uid, bool need_write)
 {
        int ret = SQLITE_OK;
 
        /*Connect DB*/
-       if (needWrite) {
+       if (need_write) {
                ret = db_util_open_with_options(__media_get_media_DB(uid), db_handle, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
        } else {
                ret = db_util_open_with_options(__media_get_media_DB(uid), db_handle, SQLITE_OPEN_READONLY, NULL);
@@ -402,14 +402,14 @@ static int _media_db_update_directly(sqlite3 *db_handle, const char *sql_str)
        return ret;
 }
 
-int media_db_connect(MediaDBHandle **handle, uid_t uid, bool needWrite)
+int media_db_connect(MediaDBHandle **handle, uid_t uid, bool need_write)
 {
        int ret = MS_MEDIA_ERR_NONE;
        sqlite3 * db_handle = NULL;
 
        MSAPI_DBG_FUNC();
 
-       ret = __media_db_connect_db_with_handle(&db_handle,uid, needWrite);
+       ret = __media_db_connect_db_with_handle(&db_handle,uid, need_write);
        MSAPI_RETV_IF(ret != MS_MEDIA_ERR_NONE, ret);
 
        *handle = db_handle;