]> granicus.if.org Git - postgresql/commitdiff
Fix some problems with patch to fsync the data directory.
authorRobert Haas <rhaas@postgresql.org>
Tue, 5 May 2015 12:30:28 +0000 (08:30 -0400)
committerRobert Haas <rhaas@postgresql.org>
Tue, 5 May 2015 13:22:51 +0000 (09:22 -0400)
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.

src/backend/storage/file/fd.c

index 193164c84dce9e8ccb417b2a3a70b1f992ea9167..7552ba0b4028f0d084d7e53c4f1867c658661033 100644 (file)
@@ -2276,7 +2276,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
@@ -2335,7 +2335,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)