handle the mmap() error of the file-size is 0 (fixes #1076)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@1739 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.14
Jan Kneschke 16 years ago
parent fb816f768b
commit 599bc83699

@ -872,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);

Loading…
Cancel
Save