Skip to content

Commit e9fcfed

Browse files
committed
Fix portability failure introduced in commits d2b0b60 et al.
I made a frontend fprintf() format use %m, forgetting that that's only safe in HEAD not the back branches; prior to 96bf88d and d6c55de, 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.
1 parent f89ae34 commit e9fcfed

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/common/psprintf.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ pvsnprintf(char *buf, size_t len, const char *fmt, va_list args)
115115
#ifndef FRONTEND
116116
elog(ERROR, "vsnprintf failed: %m with format string \"%s\"", fmt);
117117
#else
118-
fprintf(stderr, "vsnprintf failed: %m with format string \"%s\"\n", fmt);
118+
fprintf(stderr, "vsnprintf failed: %s with format string \"%s\"\n",
119+
strerror(errno), fmt);
119120
exit(EXIT_FAILURE);
120121
#endif
121122
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy