if (sock == -1) {
__STC_LOG_FUNC_EXIT__;
- return -1;
+ return STC_ERROR_INVALID_PARAMETER;
}
memset(&msg, 0, sizeof(nl_connector_msg_s));
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)
if (sock == -1) {
__STC_LOG_FUNC_EXIT__;
- return -1;
+ return STC_ERROR_INVALID_PARAMETER;
}
memset(&msg, 0, sizeof(nl_connector_msg_s));
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)
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,
/* 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)