Skip to content

Commit 6fbf4e0

Browse files
committed
Fix pg_upgrade build problem on Windows when using X_OK access
permission check on the current directory.
1 parent b3bc63e commit 6fbf4e0

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

contrib/pg_upgrade/exec.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,16 @@ void
9494
verify_directories(void)
9595
{
9696

97-
if (access(".", R_OK | W_OK | X_OK) != 0)
97+
if (access(".", R_OK | W_OK
98+
#ifndef WIN32
99+
/*
100+
* Directory execute permission on NTFS means "can execute scripts",
101+
* which we don't care about, so skip the check. Also, X_OK is not
102+
* defined in the API.
103+
*/
104+
| X_OK
105+
#endif
106+
) != 0)
98107
pg_log(PG_FATAL,
99108
"You must have read and write access in the current directory.\n");
100109

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy