postgres.git / summary / log / commit / refs
commit a31dc392d684627d0943fe67491bea91c5e619aa
Author: Bruce Momjian <bruce@momjian.us>
Date: Sat Jul 30 05:50:18 2011 +0000
First released in: 9.2.0, 9.1.0
Fix pg_update to properly test for the data directory's existence on
Win32.
Backpatch to 9.1.
contrib/pg_upgrade/exec.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/contrib/pg_upgrade/exec.c b/contrib/pg_upgrade/exec.c
index 3493696f92f..2f5e76da2dc 100644
--- a/contrib/pg_upgrade/exec.c
+++ b/contrib/pg_upgrade/exec.c
@@ -168,7 +168,9 @@ check_data_dir(const char *pg_data)
{
struct stat statBuf;
- snprintf(subDirName, sizeof(subDirName), "%s/%s", pg_data,
+ snprintf(subDirName, sizeof(subDirName), "%s%s%s", pg_data,
+ /* Win32 can't stat() a directory with a trailing slash. */
+ *requiredSubdirs[subdirnum] ? "/" : "",
requiredSubdirs[subdirnum]);
if (stat(subDirName, &statBuf) != 0)
[parent: b4fbe392f8ff]