aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGreg Stark <stark@mit.edu>2010-02-22 00:11:05 +0000
committerGreg Stark <stark@mit.edu>2010-02-22 00:11:05 +0000
commitb21121cd3d5f2b9045a02a9dd43ff98a102e0def (patch)
tree1167d220c3e06d2b0e03dd77dad96a1f63e47bae /src
parentf90a4c5df5a74ffe7f6b5346bcbae91336e52b6f (diff)
downloadpostgresql-b21121cd3d5f2b9045a02a9dd43ff98a102e0def.tar.gz
postgresql-b21121cd3d5f2b9045a02a9dd43ff98a102e0def.zip
Oops, don't forget to rewind the directory before scanning it to fsync files in CREATE DATABASE
Diffstat (limited to 'src')
-rw-r--r--src/port/copydir.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/port/copydir.c b/src/port/copydir.c
index f2b150d15e9..43fd9359c59 100644
--- a/src/port/copydir.c
+++ b/src/port/copydir.c
@@ -11,7 +11,7 @@
* as a service.
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/copydir.c,v 1.28 2010/02/15 11:40:49 stark Exp $
+ * $PostgreSQL: pgsql/src/port/copydir.c,v 1.29 2010/02/22 00:11:05 stark Exp $
*
*-------------------------------------------------------------------------
*/
@@ -90,10 +90,12 @@ copydir(char *fromdir, char *todir, bool recurse)
else if (S_ISREG(fst.st_mode))
copy_file(fromfile, tofile);
}
+ Free(xldir);
/*
* Be paranoid here and fsync all files to ensure we catch problems.
*/
+ AllocateDir(fromdir);
if (xldir == NULL)
ereport(ERROR,
(errcode_for_file_access(),