- Create rrd file for empty rrdfile in mod_rrdtool (#1788)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2418 152afb58-edef-0310-8abb-c4023f1b3aa9
This commit is contained in:
Elan Ruusamäe 2009-03-11 21:45:17 +00:00
parent 4311740cde
commit 0e84d4d4f5
2 changed files with 8 additions and 3 deletions

1
NEWS
View File

@ -6,6 +6,7 @@ NEWS
- 1.4.23 -
* Added some extra warning options in cmake and fix the resulting warnings (unused/static functions)
* New lighttpd man page (moved it to section 8) (fixes #1875)
* Create rrd file for empty rrdfile in mod_rrdtool (#1788)
- 1.4.22 - 2009-03-07
* Fix wrong lua type for CACHE_MISS/CACHE_HIT in mod_cml (fixes #533)

View File

@ -239,10 +239,15 @@ static int mod_rrdtool_create_rrd(server *srv, plugin_data *p, plugin_config *s)
"not a regular file:", s->path_rrd);
return HANDLER_ERROR;
}
} else {
}
/* still create DB if it's empty file */
if (st.st_size > 0) {
return HANDLER_GO_ON;
}
int r ;
/* create a new one */
buffer_copy_string_len(p->cmd, CONST_STR_LEN("create "));
buffer_append_string_buffer(p->cmd, s->path_rrd);
buffer_append_string_len(p->cmd, CONST_STR_LEN(
@ -287,7 +292,6 @@ static int mod_rrdtool_create_rrd(server *srv, plugin_data *p, plugin_config *s)
return HANDLER_ERROR;
}
}
return HANDLER_GO_ON;
}