From: Ickhee Woo Date: Tue, 9 Jan 2018 01:37:13 +0000 (+0900) Subject: Change debug log level from fatal to error due to dlog crash X-Git-Tag: submit/tizen/20180109.032813^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2f4ed7fe69b3f1fe89685ac91f35cd6d7f59aed9;p=platform%2Fcore%2Fapi%2Flibaccount-service.git Change debug log level from fatal to error due to dlog crash Change-Id: I4f310db2824c7c404e968937331b2726cddd9ee9 Signed-off-by: Ickhee Woo --- diff --git a/src/account.c b/src/account.c index 8f6de6f..ccab17d 100644 --- a/src/account.c +++ b/src/account.c @@ -621,7 +621,7 @@ ACCOUNT_API int account_create(account_h *account) account_s *data = (account_s *)malloc(sizeof(account_s)); if (data == NULL) { - ACCOUNT_FATAL("Memory Allocation Failed"); + ACCOUNT_ERROR("Memory Allocation Failed"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -678,7 +678,7 @@ ACCOUNT_API int account_set_user_name(account_h account, const char *user_name) _ACCOUNT_FREE(data->user_name); data->user_name = _account_get_text(user_name); if (data->user_name == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -704,7 +704,7 @@ ACCOUNT_API int account_set_display_name(account_h account, const char *display_ _ACCOUNT_FREE(data->display_name); data->display_name = _account_get_text(display_name); if (data->display_name == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -730,7 +730,7 @@ ACCOUNT_API int account_set_email_address(account_h account, const char *email_a _ACCOUNT_FREE(data->email_address); data->email_address = _account_get_text(email_address); if (data->email_address == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -756,7 +756,7 @@ ACCOUNT_API int account_set_icon_path(account_h account, const char *icon_path) _ACCOUNT_FREE(data->icon_path); data->icon_path = _account_get_text(icon_path); if (data->icon_path == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -781,7 +781,7 @@ ACCOUNT_API int account_set_source(account_h account, const char *source) _ACCOUNT_FREE(data->source); data->source = _account_get_text(source); if (data->source == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -807,7 +807,7 @@ ACCOUNT_API int account_set_package_name(account_h account, const char *package_ _ACCOUNT_FREE(data->package_name); data->package_name = _account_get_text(package_name); if (data->package_name == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -832,7 +832,7 @@ ACCOUNT_API int account_set_domain_name(account_h account, const char *domain_na _ACCOUNT_FREE(data->domain_name); data->domain_name = _account_get_text(domain_name); if (data->domain_name == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -858,7 +858,7 @@ ACCOUNT_API int account_set_access_token(account_h account, const char *access_t _ACCOUNT_FREE(data->access_token); data->access_token = _account_get_text(access_token); if (data->access_token == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -888,7 +888,7 @@ ACCOUNT_API int account_set_user_text(account_h account, int idx, const char *us _ACCOUNT_FREE(data->user_data_txt[idx]); data->user_data_txt[idx] = _account_get_text(user_txt); if (data->user_data_txt[idx] == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -929,7 +929,7 @@ ACCOUNT_API int account_set_custom(account_h account, const char *key, const cha char *new_value = NULL; new_value = _account_get_text(value); if (new_value == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -941,42 +941,28 @@ ACCOUNT_API int account_set_custom(account_h account, const char *key, const cha } if (b_is_new) { - int error_code = ACCOUNT_ERROR_NONE; - account_custom_s* custom_data = (account_custom_s *)malloc(sizeof(account_custom_s)); if (custom_data == NULL) { - ACCOUNT_FATAL("Memory Allocation Failed"); + ACCOUNT_ERROR("Memory Allocation Failed"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } ACCOUNT_MEMSET(custom_data, 0, sizeof(account_custom_s)); custom_data->account_id = data->id; - /* custom's app_id field will be automatically filled by account-svc daemon. */ -/* custom_data->app_id = _account_get_text(data->package_name); - if (data->package_name != NULL && custom_data->app_id == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); - error_code = ACCOUNT_ERROR_OUT_OF_MEMORY; - } -*/ custom_data->key = _account_get_text(key); if (custom_data->key == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); - error_code = ACCOUNT_ERROR_OUT_OF_MEMORY; + ACCOUNT_ERROR("OUT OF MEMORY\n"); + _ACCOUNT_FREE(custom_data); + return ACCOUNT_ERROR_OUT_OF_MEMORY; } custom_data->value = _account_get_text(value); if (custom_data->value == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); - error_code = ACCOUNT_ERROR_OUT_OF_MEMORY; - } - - if (error_code != ACCOUNT_ERROR_NONE) { - _ACCOUNT_FREE(custom_data->app_id); + ACCOUNT_ERROR("OUT OF MEMORY\n"); _ACCOUNT_FREE(custom_data->key); - _ACCOUNT_FREE(custom_data->value); _ACCOUNT_FREE(custom_data); - return error_code; + return ACCOUNT_ERROR_OUT_OF_MEMORY; } data->custom_list = g_slist_append(data->custom_list, (gpointer)custom_data); @@ -1080,7 +1066,7 @@ ACCOUNT_API int account_set_capability(account_h account, const char *capability if (b_is_new) { account_capability_s *cap_data = (account_capability_s *)malloc(sizeof(account_capability_s)); if (cap_data == NULL) { - ACCOUNT_FATAL("Memory Allocation Failed"); + ACCOUNT_ERROR("Memory Allocation Failed"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -1088,7 +1074,7 @@ ACCOUNT_API int account_set_capability(account_h account, const char *capability cap_data->type = _account_get_text(capability_type); if (cap_data->type == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); _ACCOUNT_FREE(cap_data->type); _ACCOUNT_FREE(cap_data); return ACCOUNT_ERROR_OUT_OF_MEMORY; @@ -1116,7 +1102,7 @@ ACCOUNT_API int account_get_user_name(account_h account, char **user_name) (*user_name) = NULL; *user_name = _account_get_text(data->user_name); if (data->user_name != NULL && *user_name == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -1139,7 +1125,7 @@ ACCOUNT_API int account_get_display_name(account_h account, char **display_name) *display_name = _account_get_text(data->display_name); if (data->display_name != NULL && *display_name == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -1163,7 +1149,7 @@ ACCOUNT_API int account_get_email_address(account_h account, char **email_addres *email_address = _account_get_text(data->email_address); if (data->email_address != NULL && *email_address == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -1186,7 +1172,7 @@ ACCOUNT_API int account_get_icon_path(account_h account, char **icon_path) *icon_path = _account_get_text(data->icon_path); if (data->icon_path != NULL && *icon_path == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -1209,7 +1195,7 @@ ACCOUNT_API int account_get_source(account_h account, char **source) *source = _account_get_text(data->source); if (data->source != NULL && *source == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -1232,7 +1218,7 @@ ACCOUNT_API int account_get_package_name(account_h account, char **package_name) *package_name = _account_get_text(data->package_name); if (data->package_name != NULL && *package_name == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -1256,7 +1242,7 @@ ACCOUNT_API int account_get_domain_name(account_h account, char **domain_name) *domain_name = _account_get_text(data->domain_name); if (data->domain_name != NULL && *domain_name == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -1279,7 +1265,7 @@ ACCOUNT_API int account_get_access_token(account_h account, char **access_token) *access_token = _account_get_text(data->access_token); if (data->access_token != NULL && *access_token == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -1304,7 +1290,7 @@ ACCOUNT_API int account_get_user_text(account_h account, int user_text_index, ch *text = _account_get_text(data->user_data_txt[user_text_index]); if (data->user_data_txt[user_text_index] != NULL && *text == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -1465,7 +1451,7 @@ ACCOUNT_API int account_get_custom(account_h account, const char *key, char **va (*value) = NULL; *value = _account_get_text(custom_data->value); if (custom_data->value != NULL && *value == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -1971,7 +1957,7 @@ ACCOUNT_API int account_type_create(account_type_h *account_type) account_type_s *data = (account_type_s *)malloc(sizeof(account_type_s)); if (data == NULL) { - ACCOUNT_FATAL("Memory Allocation Failed"); + ACCOUNT_ERROR("Memory Allocation Failed"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -2028,7 +2014,7 @@ ACCOUNT_INTERNAL_API int account_type_set_app_id(account_type_h account_type, co _ACCOUNT_FREE(data->app_id); data->app_id = _account_get_text(app_id); if (data->app_id == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -2050,7 +2036,7 @@ ACCOUNT_INTERNAL_API int account_type_set_service_provider_id(account_type_h acc _ACCOUNT_FREE(data->service_provider_id); data->service_provider_id = _account_get_text(service_provider_id); if (data->service_provider_id == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -2072,7 +2058,7 @@ ACCOUNT_INTERNAL_API int account_type_set_icon_path(account_type_h account_type, _ACCOUNT_FREE(data->icon_path); data->icon_path = _account_get_text(icon_path); if (data->icon_path == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -2094,7 +2080,7 @@ ACCOUNT_INTERNAL_API int account_type_set_small_icon_path(account_type_h account _ACCOUNT_FREE(data->small_icon_path); data->small_icon_path = _account_get_text(small_icon_path); if (data->small_icon_path == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -2129,7 +2115,7 @@ ACCOUNT_INTERNAL_API int account_type_set_label(account_type_h account_type, con account_type_s *data = (account_type_s *)account_type; label_s *label_data = (label_s *)malloc(sizeof(label_s)); if (label_data == NULL) { - ACCOUNT_FATAL("Memory Allocation Failed"); + ACCOUNT_ERROR("Memory Allocation Failed"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -2137,14 +2123,14 @@ ACCOUNT_INTERNAL_API int account_type_set_label(account_type_h account_type, con label_data->label = _account_get_text(label); if (label_data->label == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); _ACCOUNT_FREE(label_data); return ACCOUNT_ERROR_OUT_OF_MEMORY; } label_data->locale = _account_get_text(locale); if (label_data->locale == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); _ACCOUNT_FREE(label_data->label); _ACCOUNT_FREE(label_data); return ACCOUNT_ERROR_OUT_OF_MEMORY; @@ -2181,7 +2167,7 @@ ACCOUNT_INTERNAL_API int account_type_set_provider_feature(account_type_h accoun if (b_is_new) { provider_feature_s* feature_data = (provider_feature_s *)malloc(sizeof(provider_feature_s)); if (feature_data == NULL) { - ACCOUNT_FATAL("Memory Allocation Failed"); + ACCOUNT_ERROR("Memory Allocation Failed"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -2189,7 +2175,7 @@ ACCOUNT_INTERNAL_API int account_type_set_provider_feature(account_type_h accoun feature_data->key = _account_get_text(provider_feature); if (feature_data->key == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); _ACCOUNT_FREE(feature_data); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -2312,7 +2298,7 @@ ACCOUNT_API int account_type_get_app_id(account_type_h account_type, char **app_ (*app_id) = NULL; *app_id = _account_get_text(data->app_id); if (*app_id == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -2334,7 +2320,7 @@ ACCOUNT_API int account_type_get_service_provider_id(account_type_h account_type (*service_provider_id) = NULL; *service_provider_id = _account_get_text(data->service_provider_id); if (*service_provider_id == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -2356,7 +2342,7 @@ ACCOUNT_API int account_type_get_icon_path(account_type_h account_type, char **i (*icon_path) = NULL; *icon_path = _account_get_text(data->icon_path); if (*icon_path == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -2378,7 +2364,7 @@ ACCOUNT_API int account_type_get_small_icon_path(account_type_h account_type, ch (*small_icon_path) = NULL; *small_icon_path = _account_get_text(data->small_icon_path); if (*small_icon_path == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -2447,7 +2433,7 @@ ACCOUNT_API int account_type_get_label_by_locale(account_type_h account_type, co if (!strcmp(locale, label_data->locale)) { *label = _account_get_text(label_data->label); if (*label == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -2459,7 +2445,7 @@ ACCOUNT_API int account_type_get_label_by_locale(account_type_h account_type, co if ((char *)(tokens[1]) != NULL) { char *upper_token = g_ascii_strup(tokens[1], strlen(tokens[1])); if (upper_token == NULL) { - ACCOUNT_FATAL("Memory Allocation Failed"); + ACCOUNT_ERROR("Memory Allocation Failed"); g_strfreev(tokens); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -2467,7 +2453,7 @@ ACCOUNT_API int account_type_get_label_by_locale(account_type_h account_type, co if (upper_token != NULL) { char *converted_locale = g_strdup_printf("%s_%s", tokens[0], upper_token); if (converted_locale == NULL) { - ACCOUNT_FATAL("Memory Allocation Failed"); + ACCOUNT_ERROR("Memory Allocation Failed"); _ACCOUNT_FREE(upper_token); g_strfreev(tokens); return ACCOUNT_ERROR_OUT_OF_MEMORY; @@ -2479,7 +2465,7 @@ ACCOUNT_API int account_type_get_label_by_locale(account_type_h account_type, co g_strfreev(tokens); *label = _account_get_text(label_data->label); if (*label == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -2823,7 +2809,7 @@ ACCOUNT_API int account_type_query_label_by_locale(const char *app_id, const cha *label = NULL; *label = _account_get_text(label_temp); if (*label == NULL) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -2947,7 +2933,7 @@ static void _account_subscribe_vconf_callback(keynode_t *key, void *user_data) msg = strdup(vconf_key); if (msg == NULL) { - ACCOUNT_FATAL("Memory Allocation Failed"); + ACCOUNT_ERROR("Memory Allocation Failed"); return; } @@ -2982,7 +2968,7 @@ ACCOUNT_API int account_subscribe_create(account_subscribe_h *account_subscribe) account_subscribe_s *data = (account_subscribe_s *)calloc(1, sizeof(account_subscribe_s)); if (!data) { - ACCOUNT_FATAL("OUT OF MEMORY\n"); + ACCOUNT_ERROR("OUT OF MEMORY\n"); return ACCOUNT_ERROR_OUT_OF_MEMORY; } @@ -3070,7 +3056,7 @@ static void _account_subscribe_vconf_callback_ex(keynode_t *key, void *user_data } msg = strdup(vconf_key); if (msg == NULL) { - ACCOUNT_FATAL("Memory Allocation Failed"); + ACCOUNT_ERROR("Memory Allocation Failed"); return; }