Re: [HACKERS] errmsg() clobbers errno

2015-05-19 Thread Tom Lane
John Gorman writes: > While debugging an extension I discovered that the errmsg() > function zeros out errno. So might a lot of other functions used in an ereport's arguments. > This is annoying because if the process of assembling a meaningful > error message happens to call errmsg() before cal

[HACKERS] errmsg() clobbers errno

2015-05-19 Thread John Gorman
Hi All While debugging an extension I discovered that the errmsg() function zeros out errno. This is annoying because if the process of assembling a meaningful error message happens to call errmsg() before calling strerror() we lose the strerror information. This is exactly the time when we want