From 46d74424dc0d7c79ce90e810061a6984502822ba Mon Sep 17 00:00:00 2001 From: Wonsang Ryou Date: Tue, 18 Jul 2017 18:40:16 +0900 Subject: [PATCH] netutils/ntpclient: make debug message option configurable in .config This patch enables ntpclient's debug message option to be configurable in .config. You can set debug message option using the following config variable. - CONFIG_NETUTILS_NTPCLIENT_DEBUG Change-Id: Idff252265478b6006fe1995ac33e094c097b03e1 Signed-off-by: Wonsang Ryou --- apps/netutils/ntpclient/Kconfig | 6 ++++++ apps/netutils/ntpclient/ntpclient.c | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/netutils/ntpclient/Kconfig b/apps/netutils/ntpclient/Kconfig index c962f71..fc70f0d 100644 --- a/apps/netutils/ntpclient/Kconfig +++ b/apps/netutils/ntpclient/Kconfig @@ -24,4 +24,10 @@ config NETUTILS_NTPCLIENT_SIGWAKEUP default 18 depends on !DISABLE_SIGNALS +config NETUTILS_NTPCLIENT_DEBUG + bool "NTP client debug message option" + default n + ---help--- + Enable NTP client debug message + endif # NETUTILS_NTPCLIENT diff --git a/apps/netutils/ntpclient/ntpclient.c b/apps/netutils/ntpclient/ntpclient.c index 73377e5..931d5ee 100644 --- a/apps/netutils/ntpclient/ntpclient.c +++ b/apps/netutils/ntpclient/ntpclient.c @@ -85,7 +85,9 @@ #define NTP2UNIX_TRANLSLATION 2208988800u #define NTP_VERSION 3 -#define DEBUG_OPTION 0 +#ifndef CONFIG_NETUTILS_NTPCLIENT_DEBUG +#define CONFIG_NETUTILS_NTPCLIENT_DEBUG 0 +#endif /**************************************************************************** * Private Types @@ -118,7 +120,7 @@ void (*ntp_link_err_cb)(void); static struct ntpc_daemon_s g_ntpc_daemon; static struct ntpc_server_info_s g_ntps; -static int g_debug = DEBUG_OPTION; +static int g_debug = CONFIG_NETUTILS_NTPCLIENT_DEBUG; /**************************************************************************** * Private Functions Prototype -- 2.7.4