Skip to content

Commit a31dc39

Browse files
committed
Fix pg_update to properly test for the data directory's existence on
Win32. Backpatch to 9.1.
1 parent b4fbe39 commit a31dc39

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

contrib/pg_upgrade/exec.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ check_data_dir(const char *pg_data)
168168
{
169169
struct stat statBuf;
170170

171-
snprintf(subDirName, sizeof(subDirName), "%s/%s", pg_data,
171+
snprintf(subDirName, sizeof(subDirName), "%s%s%s", pg_data,
172+
/* Win32 can't stat() a directory with a trailing slash. */
173+
*requiredSubdirs[subdirnum] ? "/" : "",
172174
requiredSubdirs[subdirnum]);
173175

174176
if (stat(subDirName, &statBuf) != 0)

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