Fix a svace issue for negative code error 62/197762/2
authorhyunuktak <hyunuk.tak@samsung.com>
Wed, 16 Jan 2019 06:54:49 +0000 (15:54 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Wed, 30 Jan 2019 07:00:51 +0000 (07:00 +0000)
Change-Id: I4ed552ae7de2d691a26239c3390fde62f2a0d40f
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
packaging/stc-manager.spec
plugin/procfs/stc-plugin-procfs.c

index e34256e..f83c3f0 100644 (file)
@@ -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
index 668f15c..9538a61 100755 (executable)
@@ -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)