Correct init_cont_stats_update(), test for result
This commit is contained in:
@@ -235,7 +235,10 @@ int flexran_agent_start(mid_t mod_id)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*Initialize the continuous stats update mechanism*/
|
/*Initialize the continuous stats update mechanism*/
|
||||||
flexran_agent_init_cont_stats_update(mod_id);
|
if (flexran_agent_init_cont_stats_update(mod_id) < 0) {
|
||||||
|
LOG_E(FLEXRAN_AGENT, "could not initialize continuous stats updates\n");
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
new_thread(receive_thread, flexran);
|
new_thread(receive_thread, flexran);
|
||||||
|
|
||||||
|
|||||||
@@ -730,7 +730,7 @@ err_code_t flexran_agent_init_cont_stats_update(mid_t mod_id) {
|
|||||||
stats_context[mod_id].mutex = calloc(1, sizeof(pthread_mutex_t));
|
stats_context[mod_id].mutex = calloc(1, sizeof(pthread_mutex_t));
|
||||||
if (stats_context[mod_id].mutex == NULL)
|
if (stats_context[mod_id].mutex == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
if (pthread_mutex_init(stats_context[mod_id].mutex, NULL))
|
if (pthread_mutex_init(stats_context[mod_id].mutex, NULL) != 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user