Just for the record: a minor nit I noticed yesterday.
-- Abhijit
>From 07353c86483f7e26d44a9bbe94b32315537cee73 Mon Sep 17 00:00:00 2001
From: Abhijit Menon-Sen <[email protected]>
Date: Fri, 29 May 2015 23:15:15 +0530
Subject: The file mode is ignored without O_CREAT, so set it to 0
---
src/backend/storage/file/fd.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c
index b4f6590..2f313ff 100644
--- a/src/backend/storage/file/fd.c
+++ b/src/backend/storage/file/fd.c
@@ -416,6 +416,7 @@ void
fsync_fname(char *fname, bool isdir)
{
int fd;
+ int flags;
int returncode;
/*
@@ -423,14 +424,13 @@ fsync_fname(char *fname, bool isdir)
* systems don't allow us to fsync files opened read-only; so we need both
* cases here
*/
+ flags = PG_BINARY;
if (!isdir)
- fd = OpenTransientFile(fname,
- O_RDWR | PG_BINARY,
- S_IRUSR | S_IWUSR);
+ flags |= O_RDWR;
else
- fd = OpenTransientFile(fname,
- O_RDONLY | PG_BINARY,
- S_IRUSR | S_IWUSR);
+ flags |= O_RDONLY;
+
+ fd = OpenTransientFile(fname, flags, 0);
/*
* Some OSs don't allow us to open directories at all (Windows returns
--
1.9.1
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers