summaryrefslogtreecommitdiff
path: root/sysdep/unix/config.Y
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-04-07 11:00:36 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2010-04-07 15:34:45 +0200
commit44d4ab7a960cf143c43d1645f2985cc9d74e3077 (patch)
tree6fb7e65191951bce4d92c7b93d3a76dcf1fd9b6d /sysdep/unix/config.Y
parentb8113a5e92cb19a0910041d5708f4eafeb713b54 (diff)
Configurable syslog name.
Also fixes a bug in syslog initialization.
Diffstat (limited to 'sysdep/unix/config.Y')
-rw-r--r--sysdep/unix/config.Y10
1 files changed, 8 insertions, 2 deletions
diff --git a/sysdep/unix/config.Y b/sysdep/unix/config.Y
index ac5be7e2..844f53df 100644
--- a/sysdep/unix/config.Y
+++ b/sysdep/unix/config.Y
@@ -14,12 +14,13 @@ 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)
+CF_KEYWORDS(TIMEFORMAT, ISO, SHORT, LONG, BASE, NAME)
%type <i> log_mask log_mask_list log_cat
%type <g> log_file
%type <t> cfg_name
%type <tf> timeformat_which
+%type <t> syslog_name
CF_GRAMMAR
@@ -33,13 +34,18 @@ log_config: LOG log_file log_mask ';' {
}
;
+syslog_name:
+ NAME TEXT { $$ = $2; }
+ | { $$ = bird_name; }
+ ;
+
log_file:
TEXT {
FILE *f = tracked_fopen(new_config->pool, $1, "a");
if (!f) cf_error("Unable to open log file `%s': %m", $1);
$$ = f;
}
- | SYSLOG { $$ = NULL; }
+ | SYSLOG syslog_name { $$ = NULL; new_config->syslog_name = $2; }
| STDERR { $$ = stderr; }
;