From 90eb5e7a8bb60cb637626a3b433caf10cd8d2a03 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Mon, 25 Nov 2013 13:44:07 +0100 Subject: [PATCH] Use ISO 8601 timeformats by default. --- conf/conf.c | 3 ++- doc/bird.sgml | 16 ++++++++++------ sysdep/unix/config.Y | 4 +++- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/conf/conf.c b/conf/conf.c index 14225d3b..fc674ef3 100644 --- a/conf/conf.c +++ b/conf/conf.c @@ -96,7 +96,8 @@ config_alloc(byte *name) cfg_mem = c->mem = l; c->file_name = cfg_strdup(name); c->load_time = now; - c->tf_base.fmt1 = c->tf_log.fmt1 = "%d-%m-%Y %T"; + c->tf_route = c->tf_proto = (struct timeformat){"%T", "%F", 20*3600}; + c->tf_base = c->tf_log = (struct timeformat){"%F %T", NULL, 0}; return c; } diff --git a/doc/bird.sgml b/doc/bird.sgml index 52520a7e..269743d5 100644 --- a/doc/bird.sgml +++ b/doc/bird.sgml @@ -380,7 +380,7 @@ protocol rip { " and "table Create a new routing table. The default routing table is diff --git a/sysdep/unix/config.Y b/sysdep/unix/config.Y index 7bade918..1bba9a0d 100644 --- a/sysdep/unix/config.Y +++ b/sysdep/unix/config.Y @@ -14,7 +14,7 @@ CF_HDR CF_DECLS CF_KEYWORDS(LOG, SYSLOG, ALL, DEBUG, TRACE, INFO, REMOTE, WARNING, ERROR, AUTH, FATAL, BUG, STDERR, SOFT) -CF_KEYWORDS(TIMEFORMAT, ISO, SHORT, LONG, BASE, NAME, CONFIRM, UNDO, CHECK, TIMEOUT) +CF_KEYWORDS(TIMEFORMAT, ISO, OLD, SHORT, LONG, BASE, NAME, CONFIRM, UNDO, CHECK, TIMEOUT) %type log_mask log_mask_list log_cat cfg_timeout %type log_file @@ -96,6 +96,8 @@ timeformat_spec: | timeformat_which TEXT expr TEXT { *$1 = (struct timeformat){$2, $4, $3}; } | timeformat_which ISO SHORT { *$1 = (struct timeformat){"%T", "%F", 20*3600}; } | timeformat_which ISO LONG { *$1 = (struct timeformat){"%F %T", NULL, 0}; } + | timeformat_which OLD SHORT { *$1 = (struct timeformat){NULL, NULL, 0}; } + | timeformat_which OLD LONG { *$1 = (struct timeformat){"%d-%m-%Y %T", NULL, 0}; } ; timeformat_base: