Buildfarm still unhappy, so I'll bet it's EACCES not EPERM.
This commit is contained in:
parent
a102090995
commit
1ecafd622e
@ -11,7 +11,7 @@
|
|||||||
* as a service.
|
* as a service.
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/port/copydir.c,v 1.35 2010/03/01 00:04:06 stark Exp $
|
* $PostgreSQL: pgsql/src/port/copydir.c,v 1.36 2010/03/01 14:54:00 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -221,8 +221,9 @@ fsync_fname(char *fname, bool isdir)
|
|||||||
int fd;
|
int fd;
|
||||||
int returncode;
|
int returncode;
|
||||||
|
|
||||||
/* Some OSs require directories to be opened read-only whereas
|
/*
|
||||||
* other systems don't allow us to fsync files opened read-only so
|
* Some OSs require directories to be opened read-only whereas
|
||||||
|
* other systems don't allow us to fsync files opened read-only; so
|
||||||
* we need both cases here
|
* we need both cases here
|
||||||
*/
|
*/
|
||||||
if (!isdir)
|
if (!isdir)
|
||||||
@ -234,10 +235,11 @@ fsync_fname(char *fname, bool isdir)
|
|||||||
O_RDONLY | PG_BINARY,
|
O_RDONLY | PG_BINARY,
|
||||||
S_IRUSR | S_IWUSR);
|
S_IRUSR | S_IWUSR);
|
||||||
|
|
||||||
/* Some OSs don't allow us to open directories at all
|
/*
|
||||||
* (Windows returns EPERM)
|
* Some OSs don't allow us to open directories at all
|
||||||
|
* (Windows returns EACCES)
|
||||||
*/
|
*/
|
||||||
if (fd < 0 && isdir && (errno == EISDIR || errno == EPERM))
|
if (fd < 0 && isdir && (errno == EISDIR || errno == EACCES))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
else if (fd < 0)
|
else if (fd < 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user