Commit b21121cd authored by Greg Stark's avatar Greg Stark

Oops, don't forget to rewind the directory before scanning it to fsync files in CREATE DATABASE

parent f90a4c5d
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* as a service. * as a service.
* *
* IDENTIFICATION * 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) ...@@ -90,10 +90,12 @@ copydir(char *fromdir, char *todir, bool recurse)
else if (S_ISREG(fst.st_mode)) else if (S_ISREG(fst.st_mode))
copy_file(fromfile, tofile); copy_file(fromfile, tofile);
} }
Free(xldir);
/* /*
* Be paranoid here and fsync all files to ensure we catch problems. * Be paranoid here and fsync all files to ensure we catch problems.
*/ */
AllocateDir(fromdir);
if (xldir == NULL) if (xldir == NULL)
ereport(ERROR, ereport(ERROR,
(errcode_for_file_access(), (errcode_for_file_access(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment