Change return type from void to int
authorsaerome.kim <saerome.kim@samsung.com>
Wed, 14 Jun 2017 10:28:34 +0000 (19:28 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Mon, 17 Jul 2017 02:09:10 +0000 (11:09 +0900)
 - change mesh_network_destroy's return type

Signed-off-by: saerome.kim <saerome.kim@samsung.com>
include/mesh.h
src/mesh.c
test/mesh_network.c

index 681e2fe..a827ac2 100644 (file)
@@ -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.
index 9fe0c83..70c62ca 100644 (file)
@@ -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)
index 922b054..4aafe36 100644 (file)
@@ -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;