Re: pg_logging_init() can return ENOTTY with TAP tests

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_logging_init() can return ENOTTY with TAP tests
Дата
Msg-id 604591.1600480482@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pg_logging_init() can return ENOTTY with TAP tests  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: pg_logging_init() can return ENOTTY with TAP tests
Список pgsql-hackers
Michael Paquier <michael@paquier.xyz> writes:
> On Fri, Sep 18, 2020 at 09:56:14AM -0400, Tom Lane wrote:
>> No, this is a bad idea.  The right place to fix this is whatever code
>> segment is relying on errno to be initially zero; that is NEVER a sane
>> assumption.  That is, a valid coding pattern is something like

> So for now, what about looking at all those code paths and enforce
> errno to 0?

No, absolutely not.  That way leads to madness, because you will be trying
to enforce a system-wide property for the benefit of a few places.  There
is *no code anywhere* that promises to leave errno zero, but what you are
suggesting will soon lead to a situation where we have to require that of
everything.  It's not sane, it's not maintainable, and it's going to be
inefficient as heck, because it will require adding a whole lot more
"errno = 0" statements than the other way.

            regards, tom lane



> --
> Michael



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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: pg_logging_init() can return ENOTTY with TAP tests
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: OpenSSL 3.0.0 compatibility