From 77fbbe3c4e93d790363fafd81b88e8a7ff75ce51 Mon Sep 17 00:00:00 2001 From: oetiker Date: Thu, 28 May 2009 05:26:37 +0000 Subject: [PATCH] madvise hints may not be ORed since they are enumerated ... #224 git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.3@1835 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_open.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/program/src/rrd_open.c b/program/src/rrd_open.c index f7ccca87..6ef3596b 100644 --- a/program/src/rrd_open.c +++ b/program/src/rrd_open.c @@ -226,12 +226,14 @@ rrd_file_t *rrd_open( #ifdef USE_MADVISE if (rdwr & RRD_COPY) { /* We will read everything in a moment (copying) */ - madvise(data, rrd_file->file_len, MADV_WILLNEED | MADV_SEQUENTIAL); + madvise(data, rrd_file->file_len, MADV_WILLNEED); + madvise(data, rrd_file->file_len, MADV_SEQUENTIAL); } else { /* We do not need to read anything in for the moment */ madvise(data, rrd_file->file_len, MADV_RANDOM); /* the stat_head will be needed soonish, so hint accordingly */ - madvise(data, sizeof(stat_head_t), MADV_WILLNEED | MADV_RANDOM); + madvise(data, sizeof(stat_head_t), MADV_WILLNEED); + madvise(data, sizeof(stat_head_t), MADV_RANDOM); } #endif -- 2.30.2