diff options
Diffstat (limited to 'src/configfile.c')
-rw-r--r-- | src/configfile.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/configfile.c b/src/configfile.c index 1d3d532..5ff3261 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -218,13 +218,19 @@ static int config_insert(server *srv) { srv->srvconf.stat_cache_engine = STAT_CACHE_ENGINE_SIMPLE; } else if (buffer_is_equal_string(stat_cache_string, CONST_STR_LEN("simple"))) { srv->srvconf.stat_cache_engine = STAT_CACHE_ENGINE_SIMPLE; +#ifdef HAVE_FAM_H } else if (buffer_is_equal_string(stat_cache_string, CONST_STR_LEN("fam"))) { srv->srvconf.stat_cache_engine = STAT_CACHE_ENGINE_FAM; +#endif } else if (buffer_is_equal_string(stat_cache_string, CONST_STR_LEN("disable"))) { srv->srvconf.stat_cache_engine = STAT_CACHE_ENGINE_NONE; } else { log_error_write(srv, __FILE__, __LINE__, "sb", - "server.stat-cache-engine can be one of \"disable\", \"simple\", \"fam\", but not:", stat_cache_string); + "server.stat-cache-engine can be one of \"disable\", \"simple\"," +#ifdef HAVE_FAM_H + " \"fam\"," +#endif + " but not:", stat_cache_string); ret = HANDLER_ERROR; } @@ -866,9 +872,14 @@ int config_parse_file(server *srv, config_t *context, const char *fn) { } if (0 != stream_open(&s, filename)) { - log_error_write(srv, __FILE__, __LINE__, "sbss", - "opening configfile ", filename, "failed:", strerror(errno)); - ret = -1; + if (s.size == 0) { + /* the file was empty, nothing to parse */ + ret = 0; + } else { + log_error_write(srv, __FILE__, __LINE__, "sbss", + "opening configfile ", filename, "failed:", strerror(errno)); + ret = -1; + } } else { tokenizer_init(&t, filename, s.start, s.size); ret = config_parse(srv, context, &t); |