libpq: Use strerror_r instead of strerror
authorPeter Eisentraut <[email protected]>
Sun, 28 Jul 2024 07:12:00 +0000 (09:12 +0200)
committerPeter Eisentraut <[email protected]>
Sun, 28 Jul 2024 08:19:57 +0000 (10:19 +0200)
commit821fbd63eab0c35c034e83d278da7244cf1be463
treeb3d71fd9ab9156af41ba6647e6e299a86fd2c5ab
parent7525e4c62f99aca910566ddb0749dbaf944904c5
libpq: Use strerror_r instead of strerror

Commit 453c4687377 introduced a use of strerror() into libpq, but that
is not thread-safe.  Fix by using strerror_r() instead.

In passing, update some of the code comments added by 453c4687377, as
we have learned more about the reason for the change in OpenSSL that
started this.

Reviewed-by: Daniel Gustafsson <[email protected]>
Discussion: Discussion: https://postgr.es/m/b6fb018b-f05c-4afd-abd3-318c649faf18@highgo.ca
src/backend/libpq/be-secure-openssl.c
src/interfaces/libpq/fe-secure-openssl.c