mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-09 08:10:09 +08:00
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 to96bf88d52
andd6c55de1f
, 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.
This commit is contained in:
parent
f89ae34ab8
commit
e9fcfed3fb
@ -115,7 +115,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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user