From: hyunuktak Date: Wed, 16 Jan 2019 06:54:49 +0000 (+0900) Subject: Fix a svace issue for negative code error X-Git-Tag: accepted/tizen/unified/20190130.151736~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fconnectivity%2Fstc-manager.git;a=commitdiff_plain;h=5ac5a543cf2c66f3a9264136d1fe118a15ec8ae4 Fix a svace issue for negative code error Change-Id: I4ed552ae7de2d691a26239c3390fde62f2a0d40f Signed-off-by: hyunuktak --- diff --git a/packaging/stc-manager.spec b/packaging/stc-manager.spec index e34256e..f83c3f0 100644 --- a/packaging/stc-manager.spec +++ b/packaging/stc-manager.spec @@ -1,6 +1,6 @@ Name: stc-manager Summary: STC(Smart Traffic Control) manager -Version: 0.0.87 +Version: 0.0.88 Release: 0 Group: Network & Connectivity/Other License: Apache-2.0 diff --git a/plugin/procfs/stc-plugin-procfs.c b/plugin/procfs/stc-plugin-procfs.c index 668f15c..9538a61 100755 --- a/plugin/procfs/stc-plugin-procfs.c +++ b/plugin/procfs/stc-plugin-procfs.c @@ -447,7 +447,7 @@ static int __subscribe_proc_events(void) if (sock == -1) { __STC_LOG_FUNC_EXIT__; - return -1; + return STC_ERROR_INVALID_PARAMETER; } memset(&msg, 0, sizeof(nl_connector_msg_s)); @@ -466,11 +466,11 @@ static int __subscribe_proc_events(void) if (ret == -1) { STC_LOGE("Error sending netlink connector message"); __STC_LOG_FUNC_EXIT__; - return -1; + return STC_ERROR_FAIL; } __STC_LOG_FUNC_EXIT__; - return 0; + return STC_ERROR_NONE; } static int __unsubscribe_proc_events(void) @@ -482,7 +482,7 @@ static int __unsubscribe_proc_events(void) if (sock == -1) { __STC_LOG_FUNC_EXIT__; - return -1; + return STC_ERROR_INVALID_PARAMETER; } memset(&msg, 0, sizeof(nl_connector_msg_s)); @@ -501,11 +501,11 @@ static int __unsubscribe_proc_events(void) if (ret == -1) { STC_LOGE("Error sending netlink connector message"); __STC_LOG_FUNC_EXIT__; - return -1; + return STC_ERROR_FAIL; } __STC_LOG_FUNC_EXIT__; - return 0; + return STC_ERROR_NONE; } static bool __process_pid_cb(pid_t pid, void *user_data) @@ -542,6 +542,7 @@ static bool __process_pid_cb(pid_t pid, void *user_data) int stc_plugin_procfs_initialize(void) { __STC_LOG_FUNC_ENTER__; + int ret = STC_ERROR_NONE; proc_tree = g_tree_new_full(__proc_tree_key_compare, NULL, __proc_tree_key_free, @@ -550,28 +551,30 @@ int stc_plugin_procfs_initialize(void) /* TODO: Fill proc tree with current procfs state */ __open_nl_connector_sock(); - __subscribe_proc_events(); + ret = __subscribe_proc_events(); + __STC_LOG_FUNC_EXIT__; - return STC_ERROR_NONE; + return ret; } int stc_plugin_procfs_deinitialize(void) { __STC_LOG_FUNC_ENTER__; + int ret = STC_ERROR_NONE; if (nl_connector_sock == -1) { STC_LOGD("socket already closed"); return STC_ERROR_NONE; } - __unsubscribe_proc_events(); + ret = __unsubscribe_proc_events(); __close_nl_connector_sock(); g_tree_destroy(proc_tree); proc_tree = NULL; __STC_LOG_FUNC_EXIT__; - return STC_ERROR_NONE; + return ret; } stc_error_e stc_plugin_procfs_load(void)