Re: pgsql: Address set of issues with errno handling

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: pgsql: Address set of issues with errno handling
Дата
Msg-id 20180804121834.GG20967@paquier.xyz
обсуждение исходный текст
Ответ на Re: pgsql: Address set of issues with errno handling  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pgsql: Address set of issues with errno handling  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-committers
On Fri, Aug 03, 2018 at 04:04:36PM -0400, Tom Lane wrote:
> That's not good enough, because there is no reason to suppose that errno
> is initially zero; in reality it'll be whatever was left over from the
> last failed syscall, perhaps far distant from here.  The places that do
> this correctly do it like so:
>
> [... code ...]

Yes, I have visibly assumed that the last syscall was already failing
so those conditions would not be hit.  If the code gets changed again
that would be a problem.

> You need to go back and add the pre-clearing of errno in each of these
> places, otherwise the added code is basically useless.

I looked at all code paths enforcing ENOSPC on write() calls, and
attached is a patch to address this issue for all of them.  What do you
think?  I can of course get that addressed before the next set of minor
releases.
--
Michael

Вложения

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

Предыдущее
От: Noah Misch
Дата:
Сообщение: pgsql: Make "kerberos" test suite independent of "localhost" nameresol
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pgsql: Address set of issues with errno handling