Skip to content

Commit e2b6257

Browse files
committed
Fix PathNameOpenFile(
1 parent 9a58e00 commit e2b6257

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/backend/storage/file/cfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ static bool cfs_gc_file(char* map_path, bool background)
873873
fd2 = -1;
874874

875875
/* Persist copy of map file */
876-
if (!cfs_write_file(md2, &newMap, sizeof(FileMap)))
876+
if (!cfs_write_file(md2, newMap, sizeof(FileMap)))
877877
{
878878
elog(WARNING, "CFS failed to write file %s: %m", map_bck_path);
879879
goto Cleanup;

src/backend/storage/file/fd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ LruInsert(File file)
10711071
if (vfdP->fileFlags & PG_COMPRESSION)
10721072
{
10731073
char* mapFileName = psprintf("%s.cfm", vfdP->fileName);
1074-
vfdP->md = BasicOpenFile(mapFileName, vfdP->fileFlags & ~PG_COMPRESSION, vfdP->fileMode);
1074+
vfdP->md = BasicOpenFile(mapFileName, vfdP->fileFlags, vfdP->fileMode);
10751075
pfree(mapFileName);
10761076
if (vfdP->md < 0)
10771077
{
@@ -1342,7 +1342,7 @@ PathNameOpenFile(FileName fileName, int fileFlags, int fileMode)
13421342
if (fileFlags & PG_COMPRESSION)
13431343
{
13441344
char* mapFileName = psprintf("%s.cfm", fileName);
1345-
vfdP->md = BasicOpenFile(mapFileName, fileFlags, fileMode);
1345+
vfdP->md = BasicOpenFile(mapFileName, O_CREAT|O_RDWR|(fileFlags & ~O_EXCL), fileMode);
13461346
pfree(mapFileName);
13471347
if (vfdP->md < 0)
13481348
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy