1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-03 22:24:49 +03:00

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.
This commit is contained in:
Robert Haas 2015-05-05 08:30:28 -04:00
parent 2bc3397168
commit 53e1498c65

View File

@ -2276,7 +2276,7 @@ pre_sync_fname(char *fname, bool isdir)
{ {
int fd; 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 * Some OSs don't allow us to open directories at all (Windows returns
@ -2335,7 +2335,7 @@ walkdir(char *path, void (*action) (char *fname, bool isdir))
#ifndef WIN32 #ifndef WIN32
else if (S_ISLNK(fst.st_mode)) else if (S_ISLNK(fst.st_mode))
#else #else
else if (pg_win32_is_junction(subpath)) else if (pgwin32_is_junction(subpath))
#endif #endif
{ {
#if defined(HAVE_READLINK) || defined(WIN32) #if defined(HAVE_READLINK) || defined(WIN32)