From: Robert Haas Date: Tue, 5 May 2015 12:30:28 +0000 (-0400) Subject: Fix some problems with patch to fsync the data directory. X-Git-Tag: REL9_0_20~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=262fbcb9dd4a357a8b8147b6ac217b41e905be3a;p=thirdparty%2Fpostgresql.git Fix some problems with patch to fsync the data directory. pg_win32_is_junction() was a typo for pgwin32_is_junction(). open() was used not only in a two-argument form, which breaks on Windows, but also where BasicOpenFile() should have been used. Per reports from Andrew Dunstan and David Rowley. --- diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c index d21739dd454..de71368366d 100644 --- a/src/backend/storage/file/fd.c +++ b/src/backend/storage/file/fd.c @@ -2015,7 +2015,7 @@ pre_sync_fname(char *fname, bool isdir) { int fd; - fd = open(fname, O_RDONLY | PG_BINARY); + fd = BasicOpenFile(fname, O_RDONLY | PG_BINARY, 0); /* * Some OSs don't allow us to open directories at all (Windows returns @@ -2074,7 +2074,7 @@ walkdir(char *path, void (*action) (char *fname, bool isdir)) #ifndef WIN32 else if (S_ISLNK(fst.st_mode)) #else - else if (pg_win32_is_junction(subpath)) + else if (pgwin32_is_junction(subpath)) #endif { #if defined(HAVE_READLINK) || defined(WIN32)