Skip to content

Commit 0105a9b

Browse files
masc2008jerpelea
authored andcommitted
netutils/ntpclient: guard DHCP-only helpers
fix a warning that static function defined by not used Signed-off-by: Jerry Ma <masc2008@gmail.com>
1 parent c829571 commit 0105a9b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

netutils/ntpclient/ntpclient.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ unsigned int g_last_nsamples = 0;
227227
****************************************************************************/
228228

229229
static int ntpc_daemon(int argc, FAR char **argv);
230+
#ifdef CONFIG_NETUTILS_DHCPC
230231
static int ntpc_set_servers_from_dhcp(FAR const char *ntp_server_list);
231232

232233
static FAR char *ntpc_dup_server_list(FAR const char *ntp_server_list)
@@ -238,6 +239,7 @@ static FAR char *ntpc_dup_server_list(FAR const char *ntp_server_list)
238239

239240
return strdup(ntp_server_list);
240241
}
242+
#endif
241243

242244
static FAR const char *ntpc_select_server_list(FAR uint8_t *source)
243245
{
@@ -1687,6 +1689,7 @@ int ntpc_start(void)
16871689
return ret;
16881690
}
16891691

1692+
#ifdef CONFIG_NETUTILS_DHCPC
16901693
static int ntpc_set_servers_from_dhcp(FAR const char *ntp_server_list)
16911694
{
16921695
FAR char *new_servers;
@@ -1749,6 +1752,7 @@ static int ntpc_set_servers_from_dhcp(FAR const char *ntp_server_list)
17491752

17501753
return ret;
17511754
}
1755+
#endif
17521756

17531757
/****************************************************************************
17541758
* Name: ntpc_stop

0 commit comments

Comments
 (0)