Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6fd6669

Browse files
committed
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.
1 parent 14de825 commit 6fd6669

File tree

1 file changed

+2
-2
lines changed
  • src/backend/storage/file

1 file changed

+2
-2
lines changed

src/backend/storage/file/fd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2456,7 +2456,7 @@ pre_sync_fname(char *fname, bool isdir)
24562456
{
24572457
int fd;
24582458

2459-
fd = open(fname, O_RDONLY | PG_BINARY);
2459+
fd = BasicOpenFile(fname, O_RDONLY | PG_BINARY, 0);
24602460

24612461
/*
24622462
* Some OSs don't allow us to open directories at all (Windows returns
@@ -2515,7 +2515,7 @@ walkdir(char *path, void (*action) (char *fname, bool isdir))
25152515
#ifndef WIN32
25162516
else if (S_ISLNK(fst.st_mode))
25172517
#else
2518-
else if (pg_win32_is_junction(subpath))
2518+
else if (pgwin32_is_junction(subpath))
25192519
#endif
25202520
{
25212521
#if defined(HAVE_READLINK) || defined(WIN32)

0 commit comments

Comments
 (0)