Re: thread-safety: strerror_r()

2024-09-04 Thread Peter Eisentraut
On 02.09.24 21:56, Tom Lane wrote: Peter Eisentraut writes: I think we can apply these patches now to check this off the list of not-thread-safe functions to check. +1 for the first patch. I'm less happy with - static char errbuf[36]; + static char errbuf[128]; As a minor point

Re: thread-safety: strerror_r()

2024-09-02 Thread Tom Lane
Peter Eisentraut writes: > I think we can apply these patches now to check this off the list of > not-thread-safe functions to check. +1 for the first patch. I'm less happy with - static char errbuf[36]; + static char errbuf[128]; As a minor point, shouldn't this be + stati

thread-safety: strerror_r()

2024-09-02 Thread Peter Eisentraut
There are only a few (not necessarily thread-safe) strerror() calls in the backend; most other potential users use %m in a format string. In two cases, the reason for using strerror() was that we needed to print the error message twice, and so errno has to be reset for the second time. And/or