Re: Return value of PathNameOpenFile()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Return value of PathNameOpenFile()
Дата
Msg-id 3149754.1662473562@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Return value of PathNameOpenFile()  (Daniel Gustafsson <daniel@yesql.se>)
Ответы Re: Return value of PathNameOpenFile()  (Daniel Gustafsson <daniel@yesql.se>)
Список pgsql-hackers
Daniel Gustafsson <daniel@yesql.se> writes:
> Agreed, zero should be valid as it's a non-negative integer.  However, callers
> in fd.c are themselves checking for (fd <= 0) in some cases, and some have done
> so since the very early days of the codebase, so I wonder if there historically
> used to be a platform which considered 0 an invalid fd?

I'm betting it's a thinko that never got caught because 0 would
always be taken up by stdin.  Maybe you'd notice if you tried to
close-and-reopen stdin, but that's not something the server ever does.

            regards, tom lane



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

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: pgsql: Add ALTER SUBSCRIPTION ... SKIP.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: (doc patch) psql version compatibility