Re: Return value of PathNameOpenFile()
От | Daniel Gustafsson |
---|---|
Тема | Re: Return value of PathNameOpenFile() |
Дата | |
Msg-id | 1ECFEFA0-C3F7-450E-9571-EB22202F5B2D@yesql.se обсуждение исходный текст |
Ответ на | Return value of PathNameOpenFile() (Antonin Houska <ah@cybertec.at>) |
Ответы |
Re: Return value of PathNameOpenFile()
|
Список | pgsql-hackers |
> On 6 Sep 2022, at 09:26, Antonin Houska <ah@cybertec.at> wrote: > > I've noticed that some callers of PathNameOpenFile() > (e.g. bbsink_server_begin_archive()) consider the call failed even if the > function returned zero, while other ones do check whether the file descriptor > is strictly negative. Since the file descriptor is actually returned by the > open() system call, I assume that zero is a valid result, isn't it? 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? -- Daniel Gustafsson https://vmware.com/
В списке pgsql-hackers по дате отправления: