Re: More consistency for some file-related error message

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: More consistency for some file-related error message
Дата
Msg-id 21605.1531970645@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: More consistency for some file-related error message  (Michael Paquier <michael@paquier.xyz>)
Ответы Re: More consistency for some file-related error message  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
Michael Paquier <michael@paquier.xyz> writes:
> On Wed, Jul 18, 2018 at 10:57:16AM -0400, Tom Lane wrote:
>> BTW, isn't the initial "errno = 0" dead code now?

> Hm.  I have not bothered touching those as it could be possible that
> read() may not initialize errno to 0, so errno would remain set to any
> previous value when less bytes than expected are read, no?  It seems to
> me that the current coding is more careful.

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.

            regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Have an encrypted pgpass file
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: More consistency for some file-related error message