Re: [PATCHES] Error handling fix in interfaces/libpq/fe-secure.c

2005-07-06 Thread Tom Lane
[EMAIL PROTECTED] writes: > Tom Lane wrote: >> The gettext function does not modify the value of the global errno >> variable. This is necessary to make it possible to write something like >> >> printf (gettext ("Operation failed: %m\n")); >> >> which is pretty much what I expected to find. Ergo

Re: [PATCHES] Error handling fix in interfaces/libpq/fe-secure.c

2005-07-06 Thread jtv
Tom Lane wrote: > The gettext function does not modify the value of the global errno > variable. This is necessary to make it possible to write something like > > printf (gettext ("Operation failed: %m\n")); > > which is pretty much what I expected to find. Ergo, this entire >

Re: [PATCHES] Error handling fix in interfaces/libpq/fe-secure.c

2005-07-05 Thread Tom Lane
BTW, I read at http://www.gnu.org/software/libc/manual/html_node/Translation-with-gettext.html The gettext function does not modify the value of the global errno variable. This is necessary to make it possible to write something like printf (gettext ("Operation failed: %m\n

Re: [PATCHES] Error handling fix in interfaces/libpq/fe-secure.c

2005-07-05 Thread Tom Lane
[EMAIL PROTECTED] writes: > Here's another one similar to what I described in my previous message. More or less proves my point, no? Even if you manage to fix every occurence of this issue now, it'll keep popping up as people change the code. This approach is just not maintainable.

[PATCHES] Error handling fix in interfaces/libpq/fe-secure.c

2005-07-05 Thread jtv
Here's another one similar to what I described in my previous message. In libpq's pqsecure_read(), if SSL_read() returns -1 and sets an error of SSL_ERROR_SYSCALL, errno may be polluted by libpq_gettext() before a human-readable string is derived from it. Also, pqReadData() will see the wrong err