libc/netdb : nuttx patch, fix time info in lib_dnscache.c
This commit is patch to fix time info in lib_dnscache.c
- fix wrong usage of time function
- nuttx patch information is as follows :
- refer "fix time info in lib_dnscache.c" in nuttx main branch
@@ -168,7 +168,7 @@ void dns_save_answer(FAR const char *hostname, FAR const struct sockaddr *addr,
#if CONFIG_NETDB_DNSCLIENT_LIFESEC > 0
/* Get the current time, using CLOCK_MONOTONIC if possible */
- (void)clock_settime(DNS_CLOCK, &now);
+ (void)clock_gettime(DNS_CLOCK, &now);
entry->ctime = (time_t)now.tv_sec;
#endif
assert((hostname != NULL) && (strlen(hostname) < CONFIG_NETDB_DNSCLIENT_NAMESIZE))
@@ -228,7 +228,7 @@ int dns_find_answer(FAR const char *hostname, FAR struct sockaddr *addr, FAR soc
#if CONFIG_NETDB_DNSCLIENT_LIFESEC > 0
/* Get the current time, using CLOCK_MONOTONIC if possible */
- ret = clock_settime(DNS_CLOCK, &now);
+ ret = clock_gettime(DNS_CLOCK, &now);
#endif
/* REVISIT: This is not thread safe */
