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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Error handling fix in interfaces/libpq/fe-secure.c
Дата
Msg-id 25699.1120658138@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Error handling fix in interfaces/libpq/fe-secure.c  (jtv@xs4all.nl)
Список pgsql-patches
jtv@xs4all.nl 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, this entire
>> discussion is wrong, and whatever bug you are concerned about will
>> not be solved this way.

> Tom, I didn't know that gettext() preserved errno--but I still believe
> you're wrong.  The problem is not gettext() but libpq_gettext().  The
> latter calls the former, but it may go through initialization first--which
> would still pollute errno on the first call.

Good point --- we should make it save and restore errno around the
bindtextdomain() call.  Will do.

            regards, tom lane

В списке pgsql-patches по дате отправления:

Предыдущее
От: Neil Conway
Дата:
Сообщение: Re: patch: garbage error strings in libpq
Следующее
От: Tom Lane
Дата:
Сообщение: Re: patch: garbage error strings in libpq