Skip to content

Commit b436c72

Browse files
committed
Fix overly-complicated usage of errcode_for_file_access().
No need to do "errcode(errcode_for_file_access())", just "errcode_for_file_access()" is enough. The extra errcode() call is useless but harmless, so there's no user-visible bug here. Nevertheless, backpatch to 9.1 where this code were added.
1 parent f9c92a5 commit b436c72

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/replication/basebackup.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ sendDir(char *path, int basepathlen, bool sizeonly)
592592
{
593593
if (errno != ENOENT)
594594
ereport(ERROR,
595-
(errcode(errcode_for_file_access()),
595+
(errcode_for_file_access(),
596596
errmsg("could not stat file or directory \"%s\": %m",
597597
pathbuf)));
598598

@@ -634,7 +634,7 @@ sendDir(char *path, int basepathlen, bool sizeonly)
634634
MemSet(linkpath, 0, sizeof(linkpath));
635635
if (readlink(pathbuf, linkpath, sizeof(linkpath) - 1) == -1)
636636
ereport(ERROR,
637-
(errcode(errcode_for_file_access()),
637+
(errcode_for_file_access(),
638638
errmsg("could not read symbolic link \"%s\": %m",
639639
pathbuf)));
640640
if (!sizeonly)
@@ -728,7 +728,7 @@ sendFile(char *readfilename, char *tarfilename, struct stat * statbuf)
728728
fp = AllocateFile(readfilename, "rb");
729729
if (fp == NULL)
730730
ereport(ERROR,
731-
(errcode(errcode_for_file_access()),
731+
(errcode_for_file_access(),
732732
errmsg("could not open file \"%s\": %m", readfilename)));
733733

734734
/*

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