summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 517e8f3)
raw | patch | inline | side by side (parent: 517e8f3)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 1 Jun 2007 17:35:46 +0000 (17:35 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 1 Jun 2007 17:35:46 +0000 (17:35 +0000) |
- fill the file with DNAN and add the remaining data in after the fact ...
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1098 a5681a0c-68f1-0310-ab6d-d61299d08faa
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1098 a5681a0c-68f1-0310-ab6d-d61299d08faa
program/src/rrd_open.c | patch | blob | history | |
program/src/rrd_resize.c | patch | blob | history |
diff --git a/program/src/rrd_open.c b/program/src/rrd_open.c
index 7812da183b5dd5e61a7da9e34bdeab0dc3bc8291..e83918454cad9e3bee9ac37b819ca6e5ce401cdc 100644 (file)
--- a/program/src/rrd_open.c
+++ b/program/src/rrd_open.c
}
rrd_file->file_start = data;
if (rdwr & RRD_CREAT) {
+ memset(data, DNAN, newfile_size - 1);
goto out_done;
}
#endif
index 55ced9ec5c35f0c9f51f613872daca4294d5fe4d..b242b482f5ee5742681c195c1ac005349e83b2ff 100644 (file)
--- a/program/src/rrd_resize.c
+++ b/program/src/rrd_resize.c
rrd_write(rrd_out_file, &buffer, sizeof(rrd_value_t) * 1);
l--;
}
+#ifndef HAVE_MMAP
buffer = DNAN;
l = rrdnew.stat_head->ds_cnt * modify;
while (l > 0) {
rrd_write(rrd_out_file, &buffer, sizeof(rrd_value_t) * 1);
l--;
}
+#else
+ /* for the mmap case, we did already fill the whole new file with DNAN
+ * before we copied the old values, so nothing to do here. */
+#endif
} else {
/* Removing rows. Normally this would be just after the cursor
** however this may also mean that we wrap to the beginning of