From: saerome.kim Date: Wed, 14 Jun 2017 10:28:34 +0000 (+0900) Subject: Change return type from void to int X-Git-Tag: submit/tizen/20170828.225740~26 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=32d724c85d58ea05a8f05d0c890731712ef72484;p=platform%2Fcore%2Fapi%2Fwifi-mesh.git Change return type from void to int - change mesh_network_destroy's return type Signed-off-by: saerome.kim --- diff --git a/include/mesh.h b/include/mesh.h index 681e2fe..a827ac2 100644 --- a/include/mesh.h +++ b/include/mesh.h @@ -303,7 +303,7 @@ int mesh_network_new_with(mesh_network_h* network, const char *meshid, * @see mesh_network_destroy() * */ -void mesh_network_destroy(mesh_network_h network); +int mesh_network_destroy(mesh_network_h network); /** * @brief Gets network mesh network id. diff --git a/src/mesh.c b/src/mesh.c index 9fe0c83..70c62ca 100644 --- a/src/mesh.c +++ b/src/mesh.c @@ -118,7 +118,7 @@ EXPORT_API int mesh_network_new_with(mesh_network_h* network, const char *meshid return MESH_ERROR_NONE; } -EXPORT_API void mesh_network_destroy(mesh_network_h network) +EXPORT_API int mesh_network_destroy(mesh_network_h network) { struct mesh_network_s *net = network; CHECK_FEATURE_SUPPORTED(MESH_FEATURE); @@ -126,11 +126,13 @@ EXPORT_API void mesh_network_destroy(mesh_network_h network) if (NULL == net) { /* LCOV_EXCL_START */ LOGE("Invalid parameter"); - return; + return MESH_ERROR_INVALID_PARAMETER; /* LCOV_EXCL_STOP */ } free(net); + + return MESH_ERROR_NONE; } EXPORT_API int mesh_network_get_meshid(mesh_network_h network, char **meshid) diff --git a/test/mesh_network.c b/test/mesh_network.c index 922b054..4aafe36 100644 --- a/test/mesh_network.c +++ b/test/mesh_network.c @@ -160,7 +160,7 @@ static int run_get_found_mesh_network(MManager *mm, struct menu_data *menu) /* Clear previous found network list */ g_scan_net_idx = 1; if (g_found_network_list) - g_list_free_full(g_found_network_list, mesh_network_destroy); + g_list_free_full(g_found_network_list, (void *)mesh_network_destroy); g_found_network_list = NULL;