diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2012-07-18 19:29:33 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2012-07-18 19:29:33 +0200 |
commit | 4be266a9831799dcc2e67e83fc83d9db43828a64 (patch) | |
tree | 13e880c5b078b851ba51688ed416c6dab3754545 /sysdep/unix/main.c | |
parent | abced4a91495e27fe86b142bc1967cec53bab3dc (diff) |
Implements wildcard matching in config file include.
Also fixes some minor bugs in include.
Thanks Kelly Cochran for suggestion and draft patch.
Diffstat (limited to 'sysdep/unix/main.c')
-rw-r--r-- | sysdep/unix/main.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c index e0563aae..f0344a8f 100644 --- a/sysdep/unix/main.c +++ b/sysdep/unix/main.c @@ -162,29 +162,6 @@ cf_read(byte *dest, unsigned int len, int fd) return l; } -static int -cf_open(char *filename) -{ - char full_name[BIRD_FNAME_MAX]; - char *cur = filename; - int ret; - - if (*filename != '/') { - char dir[BIRD_FNAME_MAX]; - strncpy(dir, config_name, sizeof(dir)); - dir[sizeof(dir)-1] = 0; - snprintf(full_name, sizeof(full_name), "%s/%s", dirname(dir), filename); - full_name[sizeof(full_name)-1] = 0; - cur = full_name; - } - - if ((ret = open(cur, O_RDONLY)) == -1) - cf_error("Unable to open included configuration file: %s", cur); - - return ret; -} - - void sysdep_preconfig(struct config *c) { @@ -216,7 +193,6 @@ unix_read_config(struct config **cp, char *name) if (conf->file_fd < 0) return 0; cf_read_hook = cf_read; - cf_open_hook = cf_open; ret = config_parse(conf); close(conf->file_fd); return ret; |