projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Obviously this will only work if rrdcached is running as root which in
[rrdtool.git]
/
src
/
rrd_open.c
diff --git
a/src/rrd_open.c
b/src/rrd_open.c
index
d09f640
..
0939e7c
100644
(file)
--- a/
src/rrd_open.c
+++ b/
src/rrd_open.c
@@
-1,5
+1,5
@@
/*****************************************************************************
/*****************************************************************************
- * RRDtool 1.
3.2 Copyright by Tobi Oetiker, 1997-2008
+ * RRDtool 1.
4.2 Copyright by Tobi Oetiker, 1997-2009
*****************************************************************************
* rrd_open.c Open an RRD File
*****************************************************************************
*****************************************************************************
* rrd_open.c Open an RRD File
*****************************************************************************
@@
-172,6
+172,9
@@
rrd_file_t *rrd_open(
if (rdwr & RRD_CREAT) {
flags |= (O_CREAT | O_TRUNC);
}
if (rdwr & RRD_CREAT) {
flags |= (O_CREAT | O_TRUNC);
}
+ if (rdwr & RRD_EXCL) {
+ flags |= O_EXCL;
+ }
}
if (rdwr & RRD_READAHEAD) {
#ifdef MAP_POPULATE
}
if (rdwr & RRD_READAHEAD) {
#ifdef MAP_POPULATE
@@
-216,7
+219,10
@@
rrd_file_t *rrd_open(
} else {
rrd_file->file_len = newfile_size;
lseek(rrd_simple_file->fd, newfile_size - 1, SEEK_SET);
} else {
rrd_file->file_len = newfile_size;
lseek(rrd_simple_file->fd, newfile_size - 1, SEEK_SET);
- write(rrd_simple_file->fd, "\0", 1); /* poke */
+ if ( write(rrd_simple_file->fd, "\0", 1) == -1){ /* poke */
+ rrd_set_error("write '%s': %s", file_name, rrd_strerror(errno));
+ goto out_close;
+ }
lseek(rrd_simple_file->fd, 0, SEEK_SET);
}
#ifdef HAVE_POSIX_FADVISE
lseek(rrd_simple_file->fd, 0, SEEK_SET);
}
#ifdef HAVE_POSIX_FADVISE