Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b21121c

Browse files
committed
Oops, don't forget to rewind the directory before scanning it to fsync files in CREATE DATABASE
1 parent f90a4c5 commit b21121c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/port/copydir.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* as a service.
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/port/copydir.c,v 1.28 2010/02/15 11:40:49 stark Exp $
14+
* $PostgreSQL: pgsql/src/port/copydir.c,v 1.29 2010/02/22 00:11:05 stark Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -90,10 +90,12 @@ copydir(char *fromdir, char *todir, bool recurse)
9090
else if (S_ISREG(fst.st_mode))
9191
copy_file(fromfile, tofile);
9292
}
93+
Free(xldir);
9394

9495
/*
9596
* Be paranoid here and fsync all files to ensure we catch problems.
9697
*/
98+
AllocateDir(fromdir);
9799
if (xldir == NULL)
98100
ereport(ERROR,
99101
(errcode_for_file_access(),

0 commit comments

Comments
 (0)