Skip to content

Commit 7363282

Browse files
committed
add EPERM to the list of return codes to expect from opening directories based on Vista results
1 parent 936c4af commit 7363282

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/port/copydir.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* as a service.
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/port/copydir.c,v 1.34 2010/02/28 21:05:30 stark Exp $
14+
* $PostgreSQL: pgsql/src/port/copydir.c,v 1.35 2010/03/01 00:04:06 stark Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -234,8 +234,10 @@ fsync_fname(char *fname, bool isdir)
234234
O_RDONLY | PG_BINARY,
235235
S_IRUSR | S_IWUSR);
236236

237-
/* Some OSs don't allow us to open directories at all */
238-
if (fd < 0 && isdir && errno == EISDIR)
237+
/* Some OSs don't allow us to open directories at all
238+
* (Windows returns EPERM)
239+
*/
240+
if (fd < 0 && isdir && (errno == EISDIR || errno == EPERM))
239241
return;
240242

241243
else if (fd < 0)

0 commit comments

Comments
 (0)