From bd95d1319ec3ebbe85ca3a175c3bfddbe3348725 Mon Sep 17 00:00:00 2001 From: oetiker Date: Mon, 11 Jun 2007 10:09:54 +0000 Subject: [PATCH] Bernhard Fischer: - fix maintaining our file-pos when we have to wrap the rra_ptr in update(). - no need to update the header-data a second time for the mmap case. git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1105 a5681a0c-68f1-0310-ab6d-d61299d08faa --- src/rrd_update.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/rrd_update.c b/src/rrd_update.c index b114c9b..d8632a7 100644 --- a/src/rrd_update.c +++ b/src/rrd_update.c @@ -1334,12 +1334,10 @@ int _rrd_update( (rrd.stat_head->ds_cnt) * (rrd.rra_ptr[i].cur_row) * sizeof(rrd_value_t); if (rra_pos_tmp != rra_current) { -#ifndef HAVE_MMAP if (rrd_seek(rrd_file, rra_pos_tmp, SEEK_SET) != 0) { rrd_set_error("seek error in rrd"); break; } -#endif rra_current = rra_pos_tmp; } #ifdef DEBUG @@ -1444,7 +1442,7 @@ int _rrd_update( rrd_set_error("seek rrd for live header writeback"); goto err_free_pdp_new; } - +#ifndef HAVE_MMAP if (version >= 3) { if (rrd_write(rrd_file, rrd.live_head, sizeof(live_head_t) * 1) != sizeof(live_head_t) * 1) { @@ -1483,6 +1481,7 @@ int _rrd_update( rrd_set_error("rrd_write rra_ptr to rrd"); goto err_free_pdp_new; } +#endif #ifdef HAVE_POSIX_FADVISExxx /* with update we have write ops, so they will probably not be done by now, this means -- 2.11.0