You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/09/14 17:18:45 UTC

[incubator-nuttx-apps] branch master updated: ntpclient: fix NTP daemon state in case of DNS failure

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new bd537f2  ntpclient: fix NTP daemon state in case of DNS failure
bd537f2 is described below

commit bd537f286dd62fe94b172b77bc592409ff966d0b
Author: Pierre-Olivier Vauboin <po...@lambdaconcept.com>
AuthorDate: Mon Sep 14 14:15:43 2020 +0200

    ntpclient: fix NTP daemon state in case of DNS failure
---
 netutils/ntpclient/ntpclient.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/netutils/ntpclient/ntpclient.c b/netutils/ntpclient/ntpclient.c
index 0f215f2..bc9bfef 100644
--- a/netutils/ntpclient/ntpclient.c
+++ b/netutils/ntpclient/ntpclient.c
@@ -383,6 +383,9 @@ static int ntpc_daemon(int argc, char **argv)
     {
       nerr("ERROR: Failed to resolve '%s'\n",
            CONFIG_NETUTILS_NTPCLIENT_SERVER);
+
+      g_ntpc_daemon.state = NTP_STOPPED;
+      sem_post(&g_ntpc_daemon.sync);
       return EXIT_FAILURE;
     }
 #endif