[sysime]Bug85553
Change-Id: If4fbf839e72379d572178031b0daabb495ac46e3
diff --git a/mbtk/liblynq_lib/src/lynq_time.c b/mbtk/liblynq_lib/src/lynq_time.c
index b7a5d41..16933b4 100644
--- a/mbtk/liblynq_lib/src/lynq_time.c
+++ b/mbtk/liblynq_lib/src/lynq_time.c
@@ -100,8 +100,11 @@
{
char time_str[100] = {0};
time_t time = 0;
- while((time = (time_t)mbtk_at_systime()) == 0) {
- usleep(100000);
+ while((time = (time_t)mbtk_at_systime()) == 0)
+ {
+ printf("NTP client fail!\n");
+ LOGI("NTP client fail!\n");
+ return NULL;
}
struct tm *tm_t;
tm_t = localtime(&time);
diff --git a/mbtk/libmbtk_lib/src/mbtk_ntp.c b/mbtk/libmbtk_lib/src/mbtk_ntp.c
old mode 100755
new mode 100644
index de92991..9b1ed84
--- a/mbtk/libmbtk_lib/src/mbtk_ntp.c
+++ b/mbtk/libmbtk_lib/src/mbtk_ntp.c
@@ -226,8 +226,14 @@
/*调用取得 NTP 时间的函数*/
if (get_ntp_time(sockfd, res, &new_time_packet))
{
+ printf("NTP client success!\n");
LOGI("NTP client success!\n");
}
+ else
+ {
+ close(sockfd);
+ return 0;
+ }
close(sockfd);