aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2012-08-28 23:01:23 -0400
committerPeter Eisentraut <peter_e@gmx.net>2012-08-28 23:01:23 -0400
commit1a26e1c766fa84c2f93473eed83f0133d4b2ac5f (patch)
tree5943c2692d80f5e37573e0f1e5f7c2cc7e3c7322 /src
parent21c09e99dc252269360bd146afee9481fa80abbc (diff)
downloadpostgresql-1a26e1c766fa84c2f93473eed83f0133d4b2ac5f.tar.gz
postgresql-1a26e1c766fa84c2f93473eed83f0133d4b2ac5f.zip
Add strerror() string to chdir() error message
Diffstat (limited to 'src')
-rw-r--r--src/port/exec.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/port/exec.c b/src/port/exec.c
index 1687c9c9729..9160b636787 100644
--- a/src/port/exec.c
+++ b/src/port/exec.c
@@ -26,11 +26,13 @@
#include <unistd.h>
#ifndef FRONTEND
-/* We use only 3-parameter elog calls in this file, for simplicity */
+/* We use only 3- and 4-parameter elog calls in this file, for simplicity */
/* NOTE: caller must provide gettext call around str! */
#define log_error(str, param) elog(LOG, str, param)
+#define log_error4(str, param, arg1) elog(LOG, str, param, arg1)
#else
#define log_error(str, param) (fprintf(stderr, str, param), fputc('\n', stderr))
+#define log_error4(str, param, arg1) (fprintf(stderr, str, param, arg1), fputc('\n', stderr))
#endif
#ifdef WIN32_ONLY_COMPILER
@@ -252,7 +254,7 @@ resolve_symlinks(char *path)
*lsep = '\0';
if (chdir(path) == -1)
{
- log_error(_("could not change directory to \"%s\""), path);
+ log_error4(_("could not change directory to \"%s\": %s"), path, strerror(errno));
return -1;
}
fname = lsep + 1;
@@ -288,7 +290,7 @@ resolve_symlinks(char *path)
if (chdir(orig_wd) == -1)
{
- log_error(_("could not change directory to \"%s\""), orig_wd);
+ log_error4(_("could not change directory to \"%s\": %s"), orig_wd, strerror(errno));
return -1;
}
#endif /* HAVE_READLINK */