X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=src%2Frrd_open.c;h=78d517458861a5fac58b5e9e9064fcf43f12e537;hp=03cc5b9a1bdf09299d71f60bea509e62da68a97b;hb=96b0f4aace0deef034a792a08dc2d426cd2b61a4;hpb=8ec0b3bf999cad58f8cc33e0fb37dcf7063e4a61 diff --git a/src/rrd_open.c b/src/rrd_open.c index 03cc5b9..78d5174 100644 --- a/src/rrd_open.c +++ b/src/rrd_open.c @@ -1,24 +1,26 @@ /***************************************************************************** - * RRDtool 1.3.2 Copyright by Tobi Oetiker, 1997-2008 + * RRDtool 1.4.3 Copyright by Tobi Oetiker, 1997-2010 ***************************************************************************** * rrd_open.c Open an RRD File ***************************************************************************** * $Id$ *****************************************************************************/ +#include "rrd_tool.h" +#include "unused.h" + #ifdef WIN32 #include #include #include #endif + #ifdef HAVE_BROKEN_MS_ASYNC #include #include #endif -#include "rrd_tool.h" -#include "unused.h" #define MEMBLK 8192 #ifdef WIN32 @@ -172,6 +174,9 @@ rrd_file_t *rrd_open( if (rdwr & RRD_CREAT) { flags |= (O_CREAT | O_TRUNC); } + if (rdwr & RRD_EXCL) { + flags |= O_EXCL; + } } if (rdwr & RRD_READAHEAD) { #ifdef MAP_POPULATE @@ -683,7 +688,7 @@ ssize_t rrd_write( /* this is a leftover from the old days, it serves no purpose and is therefore turned into a no-op */ void rrd_flush( - rrd_file_t *rrd_file __attribute__((unused))) + rrd_file_t UNUSED(*rrd_file)) { } @@ -745,10 +750,10 @@ void rrd_freemem( * aligning RRAs within stripes, or other performance enhancements */ void rrd_notify_row( - rrd_file_t *rrd_file __attribute__((unused)), - int rra_idx __attribute__((unused)), - unsigned long rra_row __attribute__((unused)), - time_t rra_time __attribute__((unused))) + rrd_file_t UNUSED(*rrd_file), + int UNUSED(rra_idx), + unsigned long UNUSED(rra_row), + time_t UNUSED(rra_time)) { } @@ -760,8 +765,8 @@ void rrd_notify_row( * don't change to a new disk block at the same time */ unsigned long rrd_select_initial_row( - rrd_file_t *rrd_file __attribute__((unused)), - int rra_idx __attribute__((unused)), + rrd_file_t UNUSED(*rrd_file), + int UNUSED(rra_idx), rra_def_t *rra ) {