From: oetiker Date: Wed, 14 Nov 2007 13:53:12 +0000 (+0000) Subject: don't exit when fadvise does not work .. after all we can live without it ... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e8b59e50df384c5036fe7c63530ecdb1a7b9fdcd;p=rrdtool.git don't exit when fadvise does not work .. after all we can live without it ... git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@1220 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_open.c b/src/rrd_open.c index 2259aaa..f82f18c 100644 --- a/src/rrd_open.c +++ b/src/rrd_open.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.2.24 Copyright by Tobi Oetiker, 1997-2007 + * RRDtool 1.2.25 Copyright by Tobi Oetiker, 1997-2007 ***************************************************************************** * rrd_open.c Open an RRD File ***************************************************************************** @@ -93,11 +93,15 @@ rrd_open(const char *file_name, FILE **in_file, rrd_t *rrd, int rdwr) When we stop reading, it is highly unlikely that we start up again. In this manner we actually save time and diskaccess (and buffer cache). Thanks to Dave Plonka for the Idea of using POSIX_FADV_RANDOM here. */ - if (0 != posix_fadvise(fileno(*in_file), 0, 0, POSIX_FADV_RANDOM)) { + /* if (0 != posix_fadvise(fileno(*in_file), 0, 0, POSIX_FADV_RANDOM)) { rrd_set_error("setting POSIX_FADV_RANDOM on '%s': %s",file_name, rrd_strerror(errno)); fclose(*in_file); - return(-1); - } + return(-1); */ + + /* if it does not work, then this is sad, but we should not quit */ + posix_fadvise(fileno(*in_file), 0, 0, POSIX_FADV_RANDOM); + + /* } */ #endif /*