diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2018-12-26 15:30:10 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2018-12-26 15:30:27 -0500 |
commit | 9939ea16c2dcf98e7fe05666ed3c3d547a655250 (patch) | |
tree | ad6c5ef1e2040054286d18b6df9e0837cb9941b3 /src | |
parent | 0857575774a25a9778abd1b6f500b61092766418 (diff) | |
download | postgresql-9939ea16c2dcf98e7fe05666ed3c3d547a655250.tar.gz postgresql-9939ea16c2dcf98e7fe05666ed3c3d547a655250.zip |
Fix portability failure introduced in commits d2b0b60e7 et al.
I made a frontend fprintf() format use %m, forgetting that that's only
safe in HEAD not the back branches; prior to 96bf88d52 and d6c55de1f,
it would work on glibc platforms but not elsewhere. Revert to using
%s ... strerror(errno) as the code did before.
We could have left HEAD as-is, but for code consistency across branches,
I chose to apply this patch there too.
Per Coverity and a few buildfarm members.
Diffstat (limited to 'src')
-rw-r--r-- | src/common/psprintf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/psprintf.c b/src/common/psprintf.c index 42ce66ea388..9ca60859c88 100644 --- a/src/common/psprintf.c +++ b/src/common/psprintf.c @@ -131,7 +131,8 @@ pvsnprintf(char *buf, size_t len, const char *fmt, va_list args) #ifndef FRONTEND elog(ERROR, "vsnprintf failed: %m with format string \"%s\"", fmt); #else - fprintf(stderr, "vsnprintf failed: %m with format string \"%s\"\n", fmt); + fprintf(stderr, "vsnprintf failed: %s with format string \"%s\"\n", + strerror(errno), fmt); exit(EXIT_FAILURE); #endif } |