Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8e8ac08

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 dff178f commit 8e8ac08

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
@@ -586,7 +586,7 @@ sendDir(char *path, int basepathlen, bool sizeonly)
586586
{
587587
if (errno != ENOENT)
588588
ereport(ERROR,
589-
(errcode(errcode_for_file_access()),
589+
(errcode_for_file_access(),
590590
errmsg("could not stat file or directory \"%s\": %m",
591591
pathbuf)));
592592

@@ -628,7 +628,7 @@ sendDir(char *path, int basepathlen, bool sizeonly)
628628
MemSet(linkpath, 0, sizeof(linkpath));
629629
if (readlink(pathbuf, linkpath, sizeof(linkpath) - 1) == -1)
630630
ereport(ERROR,
631-
(errcode(errcode_for_file_access()),
631+
(errcode_for_file_access(),
632632
errmsg("could not read symbolic link \"%s\": %m",
633633
pathbuf)));
634634
if (!sizeonly)
@@ -722,7 +722,7 @@ sendFile(char *readfilename, char *tarfilename, struct stat * statbuf)
722722
fp = AllocateFile(readfilename, "rb");
723723
if (fp == NULL)
724724
ereport(ERROR,
725-
(errcode(errcode_for_file_access()),
725+
(errcode_for_file_access(),
726726
errmsg("could not open file \"%s\": %m", readfilename)));
727727

728728
/*

0 commit comments

Comments
 (0)