View Single Post

   
  #2 (permalink)  
Old 04-17-2008, 11:37 PM
Tom Lane
 
Posts: n/a
Default Re: patch: garbage error strings in libpq

jtv@xs4all.nl writes:
> Another approach would have been to make libpq_gettext() preserve errno.


That seems like a far easier, cleaner, and more robust fix than this.

Moreover I don't believe that this approach works either, as the result
of strerror() is not guaranteed still usable after another strerror call
(ie, it can use a static buffer repeatedly), so you'd still have the
problem if libpq_gettext invokes strerror. I suppose that a really
robust solution would involve libpq_gettext saving errno, restoring
errno, and invoking strerror() again ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Reply With Quote