From 8267a80c257afe8805e8365200089518e96359c7 Mon Sep 17 00:00:00 2001 From: Jaekyun Lee Date: Thu, 18 Apr 2013 14:29:27 +0900 Subject: [PATCH] Add condition for vconf and remove unused code Change-Id: Ib02ad0ac476db36d17c70f4a48dc0ede7cfeb1ea --- src/manager/net_nfc_manager.c | 16 +++++++++++++--- src/manager/net_nfc_server_ipc.c | 8 +------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/manager/net_nfc_manager.c b/src/manager/net_nfc_manager.c index aa71638..d39f9d9 100755 --- a/src/manager/net_nfc_manager.c +++ b/src/manager/net_nfc_manager.c @@ -203,14 +203,24 @@ int main(int check, char* argv[]) if (net_nfc_controller_support_nfc(&result) == true) { DEBUG_SERVER_MSG("NFC Support"); - vconf_set_bool(VCONFKEY_NFC_FEATURE, VCONFKEY_NFC_FEATURE_ON); + if (vconf_set_bool(VCONFKEY_NFC_FEATURE, VCONFKEY_NFC_FEATURE_ON) != 0) + { + DEBUG_SERVER_MSG("VCONFKEY_NFC_FEATURE ON failed"); + } } else { DEBUG_ERR_MSG("NFC doesn't support"); - vconf_set_bool(VCONFKEY_NFC_FEATURE, VCONFKEY_NFC_FEATURE_OFF); - vconf_set_bool(VCONFKEY_NFC_STATE, FALSE); + if (vconf_set_bool(VCONFKEY_NFC_FEATURE, VCONFKEY_NFC_FEATURE_OFF) != 0) + { + DEBUG_SERVER_MSG("VCONFKEY_NFC_FEATURE OFF failed"); + } + + if (vconf_set_bool(VCONFKEY_NFC_STATE, FALSE) != 0) + { + DEBUG_SERVER_MSG("VCONFKEY_NFC_STATE failed"); + } net_nfc_controller_unload(handle); } diff --git a/src/manager/net_nfc_server_ipc.c b/src/manager/net_nfc_server_ipc.c index b48ce35..e1e30ab 100755 --- a/src/manager/net_nfc_server_ipc.c +++ b/src/manager/net_nfc_server_ipc.c @@ -359,7 +359,7 @@ bool net_nfc_server_process_client_connect_request() socklen_t addrlen = 0; int client_sock_fd = 0; GIOChannel *client_channel = NULL; - uint32_t client_src_id; + uint32_t client_src_id = 0; pid_t client_pid = -1; #ifdef USE_UNIX_DOMAIN struct ucred uc; @@ -413,12 +413,6 @@ bool net_nfc_server_process_client_connect_request() return true; ERROR : - if (client_src_id > 0) - { - g_source_remove(client_src_id); - client_src_id = 0; - } - if (client_channel != NULL) { g_io_channel_unref(client_channel); -- 2.7.4