summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 782e6ff)
raw | patch | inline | side by side (parent: 782e6ff)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Thu, 18 Sep 2008 13:30:48 +0000 (13:30 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Thu, 18 Sep 2008 13:30:48 +0000 (13:30 +0000) |
file. On sparc this causes a segfault. Thanks to Sebastian Harl and Jurij Smakov for finding this.
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1512 a5681a0c-68f1-0310-ab6d-d61299d08faa
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1512 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_open.c | patch | blob | history |
diff --git a/src/rrd_open.c b/src/rrd_open.c
index 51b621f2845fccd4e2e63ce1a0d265f3d515ea39..af91c7bb5099b72c9cb380c9d28cc6eb619c4309 100644 (file)
--- a/src/rrd_open.c
+++ b/src/rrd_open.c
rrd->rra_def[i].row_cnt * rrd->stat_head->ds_cnt *
sizeof(rrd_value_t);
}
+
+ if (dontneed_start < rrd_file->file_len) {
#ifdef USE_MADVISE
- madvise(rrd_file->file_start + dontneed_start,
- rrd_file->file_len - dontneed_start, MADV_DONTNEED);
+ madvise(rrd_file->file_start + dontneed_start,
+ rrd_file->file_len - dontneed_start, MADV_DONTNEED);
#endif
#ifdef HAVE_POSIX_FADVISE
- posix_fadvise(rrd_file->fd, dontneed_start,
- rrd_file->file_len - dontneed_start, POSIX_FADV_DONTNEED);
+ posix_fadvise(rrd_file->fd, dontneed_start,
+ rrd_file->file_len - dontneed_start,
+ POSIX_FADV_DONTNEED);
#endif
+ }
+
#if defined DEBUG && DEBUG > 1
mincore_print(rrd_file, "after");
#endif