Re: More consistency for some file-related error message

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: More consistency for some file-related error message
Дата
Msg-id 20180719033330.GH3411@paquier.xyz
обсуждение исходный текст
Ответ на Re: More consistency for some file-related error message  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: More consistency for some file-related error message  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Re: More consistency for some file-related error message  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On Wed, Jul 18, 2018 at 11:24:05PM -0400, Tom Lane wrote:
> read() is required by spec to set errno when returning a negative result.
> I think the previous coding paid attention to errno regardless of the sign
> of the result, which would justify pre-zeroing it ... but the new coding
> definitely doesn't.

Yes, my point is a bit different though..  Do you think that we need to
bother about the case where errno is not 0 before calling read(), in the
case where it returns a positive result?  This would mean that errno
would still have a previous errno set, still it returned a number of
bytes read.  For the code paths discussed here that visibly does not
matter so you are right, we could remove them, still patterns get easily
copy-pasted around...
--
Michael

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: More consistency for some file-related error message
Следующее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: patch to allow disable of WAL recycling