summaryrefslogtreecommitdiffstats
path: root/src/rrd.c
diff options
context:
space:
mode:
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2017-01-14 14:19:39 +0200
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2017-01-14 14:19:39 +0200
commitbc4eed99c70910c3b3b86d16a09826885e2e1689 (patch)
tree26ebf5579307b732645ad5feeacfc6924baa0de5 /src/rrd.c
parentf0c40b331aa4c3c65650cb164c5fb26dbbbc971f (diff)
ensure the database is always saved on exit
Diffstat (limited to 'src/rrd.c')
-rw-r--r--src/rrd.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/rrd.c b/src/rrd.c
index 365ad87624..16375c579b 100644
--- a/src/rrd.c
+++ b/src/rrd.c
@@ -880,14 +880,7 @@ void rrdset_free_all(void)
pthread_rwlock_unlock(&st->rwlock);
- if(st->mapped == RRD_MEMORY_MODE_SAVE) {
- debug(D_RRD_CALLS, "Saving stats '%s' to '%s'.", st->name, st->cache_filename);
- savememory(st->cache_filename, st, st->memsize);
-
- debug(D_RRD_CALLS, "Unmapping stats '%s'.", st->name);
- munmap(st, st->memsize);
- }
- else if(st->mapped == RRD_MEMORY_MODE_MAP) {
+ if(st->mapped == RRD_MEMORY_MODE_SAVE || st->mapped == RRD_MEMORY_MODE_MAP) {
debug(D_RRD_CALLS, "Unmapping stats '%s'.", st->name);
munmap(st, st->memsize);
}