Commit b436c72f authored by Heikki Linnakangas's avatar Heikki Linnakangas

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.
parent f9c92a5a
...@@ -592,7 +592,7 @@ sendDir(char *path, int basepathlen, bool sizeonly) ...@@ -592,7 +592,7 @@ sendDir(char *path, int basepathlen, bool sizeonly)
{ {
if (errno != ENOENT) if (errno != ENOENT)
ereport(ERROR, ereport(ERROR,
(errcode(errcode_for_file_access()), (errcode_for_file_access(),
errmsg("could not stat file or directory \"%s\": %m", errmsg("could not stat file or directory \"%s\": %m",
pathbuf))); pathbuf)));
...@@ -634,7 +634,7 @@ sendDir(char *path, int basepathlen, bool sizeonly) ...@@ -634,7 +634,7 @@ sendDir(char *path, int basepathlen, bool sizeonly)
MemSet(linkpath, 0, sizeof(linkpath)); MemSet(linkpath, 0, sizeof(linkpath));
if (readlink(pathbuf, linkpath, sizeof(linkpath) - 1) == -1) if (readlink(pathbuf, linkpath, sizeof(linkpath) - 1) == -1)
ereport(ERROR, ereport(ERROR,
(errcode(errcode_for_file_access()), (errcode_for_file_access(),
errmsg("could not read symbolic link \"%s\": %m", errmsg("could not read symbolic link \"%s\": %m",
pathbuf))); pathbuf)));
if (!sizeonly) if (!sizeonly)
...@@ -728,7 +728,7 @@ sendFile(char *readfilename, char *tarfilename, struct stat * statbuf) ...@@ -728,7 +728,7 @@ sendFile(char *readfilename, char *tarfilename, struct stat * statbuf)
fp = AllocateFile(readfilename, "rb"); fp = AllocateFile(readfilename, "rb");
if (fp == NULL) if (fp == NULL)
ereport(ERROR, ereport(ERROR,
(errcode(errcode_for_file_access()), (errcode_for_file_access(),
errmsg("could not open file \"%s\": %m", readfilename))); errmsg("could not open file \"%s\": %m", readfilename)));
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment