Skip to content

Commit

Permalink
Fix wait_for_network, tested now too.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahkok committed Nov 6, 2019
1 parent 0407325 commit 65b6edd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/ccmodules.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ extern struct cc_module_handler_struct hostname_cc_module;
extern struct cc_module_handler_struct runcmd_cc_module;
extern struct cc_module_handler_struct envar_cc_module;
extern struct cc_module_handler_struct fbootcmd_cc_module;
extern struct cc_module_handler_struct wait_for_network_cc_module;

struct cc_module_handler_struct *cc_module_structs[] = {
&package_upgrade_cc_module,
Expand All @@ -63,6 +64,7 @@ struct cc_module_handler_struct *cc_module_structs[] = {
&runcmd_cc_module,
&envar_cc_module,
&fbootcmd_cc_module,
&wait_for_network_cc_module,
NULL
};

3 changes: 1 addition & 2 deletions src/ccmodules/wait-for-network.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,10 @@ void wait_for_network(void) {
// don't re-enter
do_network_wait = 2;

memset(he, 0, sizeof(struct hostent));
LOG(MOD "Waiting for an active network connection.\n");
for (;;) {
he = gethostbyname(DNSTESTADDR);
if (he) {
if (he != NULL) {
LOG(MOD "Network appears active, waiting completed.\n");
break;
}
Expand Down

0 comments on commit 65b6edd

Please sign in to comment.