mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
- Fix #4152: Logs shows wrong time when using log-time-ascii: yes.
git-svn-id: file:///svn/unbound/trunk@4957 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
9a877e0e9a
commit
c9955f9fdf
4 changed files with 2 additions and 20 deletions
|
|
@ -1802,8 +1802,6 @@ worker_init(struct worker* worker, struct config_file *cfg,
|
||||||
alloc_set_id_cleanup(&worker->alloc, &worker_alloc_cleanup, worker);
|
alloc_set_id_cleanup(&worker->alloc, &worker_alloc_cleanup, worker);
|
||||||
worker->env = *worker->daemon->env;
|
worker->env = *worker->daemon->env;
|
||||||
comm_base_timept(worker->base, &worker->env.now, &worker->env.now_tv);
|
comm_base_timept(worker->base, &worker->env.now, &worker->env.now_tv);
|
||||||
if(worker->thread_num == 0)
|
|
||||||
log_set_time(worker->env.now);
|
|
||||||
worker->env.worker = worker;
|
worker->env.worker = worker;
|
||||||
worker->env.worker_base = worker->base;
|
worker->env.worker_base = worker->base;
|
||||||
worker->env.send_query = &worker_send_query;
|
worker->env.send_query = &worker_send_query;
|
||||||
|
|
@ -1909,7 +1907,6 @@ worker_delete(struct worker* worker)
|
||||||
comm_timer_delete(worker->env.probe_timer);
|
comm_timer_delete(worker->env.probe_timer);
|
||||||
free(worker->ports);
|
free(worker->ports);
|
||||||
if(worker->thread_num == 0) {
|
if(worker->thread_num == 0) {
|
||||||
log_set_time(NULL);
|
|
||||||
#ifdef UB_ON_WINDOWS
|
#ifdef UB_ON_WINDOWS
|
||||||
wsvc_desetup_worker(worker);
|
wsvc_desetup_worker(worker);
|
||||||
#endif /* UB_ON_WINDOWS */
|
#endif /* UB_ON_WINDOWS */
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
adds the option unknown-server-time-limit to unbound.conf that
|
adds the option unknown-server-time-limit to unbound.conf that
|
||||||
can be increased to avoid the problem.
|
can be increased to avoid the problem.
|
||||||
- remade makefile dependencies.
|
- remade makefile dependencies.
|
||||||
|
- Fix #4152: Logs shows wrong time when using log-time-ascii: yes.
|
||||||
|
|
||||||
24 October 2018: Ralph
|
24 October 2018: Ralph
|
||||||
- Add markdel function to ECS slabhash.
|
- Add markdel function to ECS slabhash.
|
||||||
|
|
|
||||||
11
util/log.c
11
util/log.c
|
|
@ -78,8 +78,6 @@ static const char* ident="unbound";
|
||||||
/** are we using syslog(3) to log to */
|
/** are we using syslog(3) to log to */
|
||||||
static int logging_to_syslog = 0;
|
static int logging_to_syslog = 0;
|
||||||
#endif /* HAVE_SYSLOG_H */
|
#endif /* HAVE_SYSLOG_H */
|
||||||
/** time to print in log, if NULL, use time(2) */
|
|
||||||
static time_t* log_now = NULL;
|
|
||||||
/** print time in UTC or in secondsfrom1970 */
|
/** print time in UTC or in secondsfrom1970 */
|
||||||
static int log_time_asc = 0;
|
static int log_time_asc = 0;
|
||||||
|
|
||||||
|
|
@ -181,11 +179,6 @@ void log_ident_set(const char* id)
|
||||||
ident = id;
|
ident = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
void log_set_time(time_t* t)
|
|
||||||
{
|
|
||||||
log_now = t;
|
|
||||||
}
|
|
||||||
|
|
||||||
void log_set_time_asc(int use_asc)
|
void log_set_time_asc(int use_asc)
|
||||||
{
|
{
|
||||||
log_time_asc = use_asc;
|
log_time_asc = use_asc;
|
||||||
|
|
@ -255,9 +248,7 @@ log_vmsg(int pri, const char* type,
|
||||||
lock_quick_unlock(&log_lock);
|
lock_quick_unlock(&log_lock);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(log_now)
|
now = (time_t)time(NULL);
|
||||||
now = (time_t)*log_now;
|
|
||||||
else now = (time_t)time(NULL);
|
|
||||||
#if defined(HAVE_STRFTIME) && defined(HAVE_LOCALTIME_R)
|
#if defined(HAVE_STRFTIME) && defined(HAVE_LOCALTIME_R)
|
||||||
if(log_time_asc && strftime(tmbuf, sizeof(tmbuf), "%b %d %H:%M:%S",
|
if(log_time_asc && strftime(tmbuf, sizeof(tmbuf), "%b %d %H:%M:%S",
|
||||||
localtime_r(&now, &tm))%(sizeof(tmbuf)) != 0) {
|
localtime_r(&now, &tm))%(sizeof(tmbuf)) != 0) {
|
||||||
|
|
|
||||||
|
|
@ -112,13 +112,6 @@ int log_thread_get(void);
|
||||||
*/
|
*/
|
||||||
void log_ident_set(const char* id);
|
void log_ident_set(const char* id);
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the time value to print in log entries.
|
|
||||||
* @param t: the point is copied and used to find the time.
|
|
||||||
* if NULL, time(2) is used.
|
|
||||||
*/
|
|
||||||
void log_set_time(time_t* t);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set if the time value is printed ascii or decimal in log entries.
|
* Set if the time value is printed ascii or decimal in log entries.
|
||||||
* @param use_asc: if true, ascii is printed, otherwise decimal.
|
* @param use_asc: if true, ascii is printed, otherwise decimal.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue