pg_logging_init() can return ENOTTY with TAP tests

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема pg_logging_init() can return ENOTTY with TAP tests
Дата
Msg-id 20200918095713.GA20887@paquier.xyz
обсуждение исходный текст
Ответы Re: pg_logging_init() can return ENOTTY with TAP tests  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi,

While hacking my way around a different patch (better option handling
for pg_test_fsync), I got surprised by the fact that if we run the TAP
tests, logging initialization could return with errno set to ENOTTY
because we call isatty() to check for output coloring.  I found that
this can be possible with Debian gid that uses a recent version of
IPC::Run.

Some system calls may not set errno even if they succeed, like
strtol() on Linux for example, so in this case it can cause option
handling to fail because of the error set by logging initialization.
Shouldn't we reset errno to 0 once logging initialization is done?  It
seems to me that this code path should finish with a clean sheet, and
attached is a proposal of patch to address this issue.

Thoughts?
--
Michael

Вложения

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

Предыдущее
От: Julien Rouhaud
Дата:
Сообщение: Re: [PATCH] Add features to pg_stat_statements
Следующее
От: Ashutosh Bapat
Дата:
Сообщение: Re: Report error position in partition bound check