From: oetiker Date: Sat, 18 Oct 2008 22:32:19 +0000 (+0000) Subject: rrd_open should not create files with restrictive masks X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=59525f3de81d5f6a9c5e5fc3a6662fa7e074163f;p=rrdtool.git rrd_open should not create files with restrictive masks Removed unnecessary "mode" varaible. The mode is only used when O_CREAT is specified, where we want to use 0666 (as rrd_create_fn did r<=1612). --kevin git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1620 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_open.c b/src/rrd_open.c index 101e3c3..a83031a 100644 --- a/src/rrd_open.c +++ b/src/rrd_open.c @@ -71,7 +71,6 @@ rrd_file_t *rrd_open( { int i; int flags = 0; - mode_t mode = S_IRUSR; int version; #ifdef HAVE_MMAP @@ -146,7 +145,6 @@ rrd_file_t *rrd_open( #endif } else { if (rdwr & RRD_READWRITE) { - mode |= S_IWUSR; flags |= O_RDWR; #ifdef HAVE_MMAP rrd_simple_file->mm_flags = MAP_SHARED; @@ -169,7 +167,7 @@ rrd_file_t *rrd_open( flags |= O_BINARY; #endif - if ((rrd_simple_file->fd = open(file_name, flags, mode)) < 0) { + if ((rrd_simple_file->fd = open(file_name, flags, 0666)) < 0) { rrd_set_error("opening '%s': %s", file_name, rrd_strerror(errno)); goto out_free; }