[0.1.21] Fix format specifiers
[platform/core/account/account-manager.git] / server / src / account-server-db.c
index bf61430..8ba8eec 100644 (file)
@@ -234,7 +234,7 @@ int _account_global_db_open(void)
        ACCOUNT_GET_GLOBAL_DB_PATH(account_db_path, sizeof(account_db_path));
 
        if (g_hAccountGlobalDB) {
-               _ERR("Account database is using in another app. %x", g_hAccountDB);
+               _ERR("Account database is using in another app");
                return _ACCOUNT_ERROR_DATABASE_BUSY;
        }
 
@@ -337,7 +337,7 @@ int _account_db_open(int mode, int pid, uid_t uid)
        ACCOUNT_GET_USER_DB_PATH(account_db_path, sizeof(account_db_path), uid);
 
        if (g_hAccountDB) {
-               _ERR("Account database is using in another app. %x", g_hAccountDB);
+               _ERR("Account database is using in another app");
                return _ACCOUNT_ERROR_DATABASE_BUSY;
        }
 
@@ -571,6 +571,8 @@ static int _account_update_capability(account_s *account, int account_id)
 
        if (rc != SQLITE_DONE) {
                ACCOUNT_ERROR("_account_query_step() failed(%d, %s)", rc, _account_db_err_msg(g_hAccountDB));
+               if (_account_query_finalize(hstmt) != _ACCOUNT_ERROR_NONE)
+                       _ERR("finalize error - account_query_step() failed");
                return _ACCOUNT_ERROR_DB_FAILED;
        }
        rc = _account_query_finalize(hstmt);
@@ -652,6 +654,8 @@ static int _account_update_capability_by_user_name(account_s *account, const cha
        rc = _account_query_step(hstmt);
        if (rc != SQLITE_DONE) {
                ACCOUNT_ERROR("_account_query_step() failed(%d, %s)", rc, _account_db_err_msg(g_hAccountDB));
+               if (_account_query_finalize(hstmt) != _ACCOUNT_ERROR_NONE)
+                       _ERR("finalize error - account_query_step() failed");
                return _ACCOUNT_ERROR_DB_FAILED;
        }
 
@@ -3204,7 +3208,7 @@ static int _account_type_update_provider_feature(sqlite3 *account_db_handle, acc
                return _ACCOUNT_ERROR_NONE;
        }
 
-       ACCOUNT_DEBUG("app id", app_id);
+       ACCOUNT_DEBUG("app id[%s]", app_id);
 
        ACCOUNT_MEMSET(query, 0x00, sizeof(query));
 
@@ -3222,6 +3226,8 @@ static int _account_type_update_provider_feature(sqlite3 *account_db_handle, acc
 
        if (rc != SQLITE_DONE) {
                ACCOUNT_ERROR("_account_query_step() failed(%d, %s)", rc, _account_db_err_msg(account_db_handle));
+               if (_account_query_finalize(hstmt) != _ACCOUNT_ERROR_NONE)
+                       _ERR("finalize error - account_query_step() failed");
                return _ACCOUNT_ERROR_DB_FAILED;
        }
        rc = _account_query_finalize(hstmt);
@@ -3290,6 +3296,8 @@ static int _account_type_update_label(sqlite3 *account_db_handle, account_type_s
 
        if (rc != SQLITE_DONE) {
                ACCOUNT_ERROR("_account_query_step() failed(%d, %s)", rc, _account_db_err_msg(account_db_handle));
+               if (_account_query_finalize(hstmt) != _ACCOUNT_ERROR_NONE)
+                       _ERR("finalize error - account_query_step() failed");
                return _ACCOUNT_ERROR_DB_FAILED;
        }
        rc = _account_query_finalize(hstmt);
@@ -3921,7 +3929,7 @@ int _account_type_query_by_provider_feature_from_global_db(const char* key, GSLi
        rc = _account_query_finalize(hstmt);
        if (rc != _ACCOUNT_ERROR_NONE) {
                _account_type_gslist_account_type_free(account_type_list);
-               ACCOUNT_ERROR("finalize error(%s)", rc);
+               ACCOUNT_ERROR("finalize error(%d)", rc);
                error_code = rc;
                goto CATCH;
        }
@@ -3952,7 +3960,7 @@ CATCH:
        if (hstmt != NULL) {
                rc = _account_query_finalize(hstmt);
                if (rc != _ACCOUNT_ERROR_NONE) {
-                       ACCOUNT_ERROR("finalize error(%s)", rc);
+                       ACCOUNT_ERROR("finalize error(%d)", rc);
                        return rc;
                }
                hstmt = NULL;
@@ -4026,7 +4034,7 @@ GSList* _account_type_query_by_provider_feature(const char* key, int *error_code
        rc = _account_query_finalize(hstmt);
        if (rc != _ACCOUNT_ERROR_NONE) {
                _account_type_gslist_account_type_free(account_type_list);
-               ACCOUNT_ERROR("finalize error(%s)", rc);
+               ACCOUNT_ERROR("finalize error(%d)", rc);
                *error_code = rc;
                goto CATCH;
        }
@@ -4428,7 +4436,7 @@ static int _account_insert_custom(account_s *account, int account_id)
        rc = _account_get_record_count(g_hAccountDB, query);
 
        if (_account_db_err_code(g_hAccountDB) == SQLITE_PERM) {
-               ACCOUNT_ERROR("Access failed(%d, %s)", _account_db_err_msg(g_hAccountDB));
+               ACCOUNT_ERROR("Access failed(%s)", _account_db_err_msg(g_hAccountDB));
                return _ACCOUNT_ERROR_PERMISSION_DENIED;
        }
 
@@ -4529,9 +4537,13 @@ static int _account_update_custom(account_s *account, int account_id)
 
        if (rc == SQLITE_BUSY) {
                ACCOUNT_ERROR("_account_query_step() failed(%d, %s)", rc, _account_db_err_msg(g_hAccountDB));
+               if (_account_query_finalize(hstmt) != _ACCOUNT_ERROR_NONE)
+                       _ERR("finalize error - account_query_step() failed");
                return _ACCOUNT_ERROR_DATABASE_BUSY;
        } else if (rc != SQLITE_DONE) {
                ACCOUNT_ERROR("_account_query_step() failed(%d, %s)", rc, _account_db_err_msg(g_hAccountDB));
+               if (_account_query_finalize(hstmt) != _ACCOUNT_ERROR_NONE)
+                       _ERR("finalize error - account_query_step() failed");
                return _ACCOUNT_ERROR_DB_FAILED;
        }