Commit c3a24e31 authored by Tom Lane's avatar Tom Lane

Some platforms reject fsync() on files opened O_RDONLY.

parent 1180b640
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* as a service. * as a service.
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/port/copydir.c,v 1.31 2010/02/22 15:29:46 tgl Exp $ * $PostgreSQL: pgsql/src/port/copydir.c,v 1.32 2010/02/23 05:44:55 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -221,7 +221,7 @@ static void ...@@ -221,7 +221,7 @@ static void
fsync_fname(char *fname) fsync_fname(char *fname)
{ {
int fd = BasicOpenFile(fname, int fd = BasicOpenFile(fname,
O_RDONLY | PG_BINARY, O_RDWR | PG_BINARY,
S_IRUSR | S_IWUSR); S_IRUSR | S_IWUSR);
if (fd < 0) if (fd < 0)
...@@ -229,8 +229,6 @@ fsync_fname(char *fname) ...@@ -229,8 +229,6 @@ fsync_fname(char *fname)
(errcode_for_file_access(), (errcode_for_file_access(),
errmsg("could not open file \"%s\": %m", fname))); errmsg("could not open file \"%s\": %m", fname)));
errno = 0;
if (pg_fsync(fd) != 0) if (pg_fsync(fd) != 0)
ereport(ERROR, ereport(ERROR,
(errcode_for_file_access(), (errcode_for_file_access(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment