Re: Improved fix for sys_nerr

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Improved fix for sys_nerr
Дата
Msg-id Pine.LNX.4.21.0010272057530.838-100000@peter.localdomain
обсуждение исходный текст
Ответ на Re: Improved fix for sys_nerr  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
Tom Lane writes:

> I recommend adding a configure test to see whether sys_nerr exists,
> and trusting strerror() to be bulletproof only where it does not.
>
> As you say, there could be holes in the error number assignment,
> so an additional test for NULL result from strerror() seems wise.

Definitely a good plan.  If someone wants to be really dilligent he could
write up a "pgstrerror", which

1. does the str_nerr check if it exists
2. runs strerror(errno)
3. checks for NULL or EINVAL
4. returns something useful

You put that into src/utils and link it into every program or library that
uses strerror.

Any reasonable subset of this solution would be fine as well. :)

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Improved fix for sys_nerr
Следующее
От: Pete Forman
Дата:
Сообщение: Re: Improved fix for sys_nerr