Browse Source

- 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
svn/tags/lighttpd-1.4.23
Elan Ruusamäe 13 years ago
parent
commit
0e84d4d4f5
  1. 1
      NEWS
  2. 10
      src/mod_rrdtool.c

1
NEWS

@ -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)

10
src/mod_rrdtool.c

@ -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;
}

Loading…
Cancel
Save