Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 47c93ac

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 a016f59 commit 47c93ac

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
@@ -131,7 +131,8 @@ pvsnprintf(char *buf, size_t len, const char *fmt, va_list args)
131131
#ifndef FRONTEND
132132
elog(ERROR, "vsnprintf failed: %m with format string \"%s\"", fmt);
133133
#else
134-
fprintf(stderr, "vsnprintf failed: %m with format string \"%s\"\n", fmt);
134+
fprintf(stderr, "vsnprintf failed: %s with format string \"%s\"\n",
135+
strerror(errno), fmt);
135136
exit(EXIT_FAILURE);
136137
#endif
137138
}

0 commit comments

Comments
 (0)