Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
sol-netctl: add the init and shutdown process of sol-netctl
Browse files Browse the repository at this point in the history
The init and shutdown process of sol-netctl need to be added to
the init and shutdown process of sol-comms.

Signed-off-by: Wu Zheng <[email protected]>
  • Loading branch information
wzhen12 committed May 24, 2016
1 parent b95aad2 commit 19c60cb
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/lib/comms/sol-comms.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ extern void sol_network_shutdown(void);
extern void sol_oic_server_shutdown(void);
#endif

#ifdef NETCTL
extern int sol_netctl_init(void);
extern void sol_netctl_shutdown(void);
#else
static int
sol_netctl_init(void)
{
return 0;
}

static void
sol_netctl_shutdown(void)
{
}
#endif

int sol_comms_init(void);
void sol_comms_shutdown(void);

Expand All @@ -74,8 +90,14 @@ sol_comms_init(void)
if (ret != 0)
goto http_server_error;

ret = sol_netctl_init();
if (ret != 0)
goto netctl_error;

return 0;

netctl_error:
sol_netctl_shutdown();
http_server_error:
sol_http_client_init();
http_client_error:
Expand All @@ -93,4 +115,5 @@ sol_comms_shutdown(void)
sol_http_client_shutdown();
sol_http_server_shutdown();
sol_network_shutdown();
sol_netctl_shutdown();
}

0 comments on commit 19c60cb

Please sign in to comment.