postgresql/src/common
Tom Lane d6c55de1f9 Implement %m in src/port/snprintf.c, and teach elog.c to rely on that.
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
2018-09-26 13:31:56 -04:00
..
unicode Fix more wrong paths in header comments 2018-07-11 17:57:04 +03:00
base64.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
config_info.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
controldata_utils.c Add proper errcodes to new error messages for read() failures 2018-07-23 09:37:36 +09:00
exec.c Produce compiler errors if errno is referenced inside elog/ereport calls. 2018-08-11 11:23:41 -04:00
fe_memutils.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
file_perm.c Fix more wrong paths in header comments 2018-07-11 17:57:04 +03:00
file_utils.c Allow concurrent-safe open() and fopen() in frontend code for Windows 2018-09-14 10:04:14 +09:00
ip.c Clean up assorted misuses of snprintf()'s result value. 2018-08-15 16:29:31 -04:00
keywords.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
link-canary.c Install a check for mis-linking of src/port and src/common functions. 2018-09-09 12:23:23 -04:00
Makefile Install a check for mis-linking of src/port and src/common functions. 2018-09-09 12:23:23 -04:00
md5.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
pg_lzcompress.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
pgfnames.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
psprintf.c Implement %m in src/port/snprintf.c, and teach elog.c to rely on that. 2018-09-26 13:31:56 -04:00
relpath.c Further cleanup of client dependencies on src/include/catalog headers. 2018-04-09 14:39:58 -04:00
restricted_token.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
rmtree.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
saslprep.c Minor cleanup/future-proofing for pg_saslprep(). 2018-09-08 18:20:36 -04:00
scram-common.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
sha2.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
sha2_openssl.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
string.c restrict -> pg_restrict 2018-03-15 10:02:59 -03:00
unicode_norm.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
username.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
wait_error.c Update copyright for 2018 2018-01-02 23:30:12 -05:00