mirror of
https://github.com/postgres/postgres.git
synced 2026-03-10 18:28:35 -04:00
I started out with the idea that we needed to detect use of %m format specs
in contexts other than elog/ereport calls, because we couldn't rely on that
working in *printf calls. But a better answer is to fix things so that it
does work. Now that we're using snprintf.c all the time, we can implement
%m in that and we've fixed the problem.
This requires also adjusting our various printf-wrapping functions so that
they ensure "errno" is preserved when they call snprintf.c.
Remove elog.c's handmade implementation of %m, and let it rely on
snprintf to support the feature. That should provide some performance
gain, though I've not attempted to measure it.
There are a lot of places where we could now simplify 'printf("%s",
strerror(errno))' into 'printf("%m")', but I'm not in any big hurry
to make that happen.
Patch by me, reviewed by Michael Paquier
Discussion: https://postgr.es/m/2975.1526862605@sss.pgh.pa.us
|
||
|---|---|---|
| .. | ||
| unicode | ||
| base64.c | ||
| config_info.c | ||
| controldata_utils.c | ||
| exec.c | ||
| fe_memutils.c | ||
| file_perm.c | ||
| file_utils.c | ||
| ip.c | ||
| keywords.c | ||
| link-canary.c | ||
| Makefile | ||
| md5.c | ||
| pg_lzcompress.c | ||
| pgfnames.c | ||
| psprintf.c | ||
| relpath.c | ||
| restricted_token.c | ||
| rmtree.c | ||
| saslprep.c | ||
| scram-common.c | ||
| sha2.c | ||
| sha2_openssl.c | ||
| string.c | ||
| unicode_norm.c | ||
| username.c | ||
| wait_error.c | ||