Re: Replace open mode with PG_BINARY_R/W/A macros
От | Japin Li |
---|---|
Тема | Re: Replace open mode with PG_BINARY_R/W/A macros |
Дата | |
Msg-id | MEYP282MB16693D20326B896FDDE4F3C4B6F79@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM обсуждение исходный текст |
Ответ на | Re: Replace open mode with PG_BINARY_R/W/A macros (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Replace open mode with PG_BINARY_R/W/A macros
|
Список | pgsql-hackers |
On Fri, 22 Apr 2022 at 04:38, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes: >> On 20.04.22 22:29, Tom Lane wrote: >>> PG_BINARY is useful for open(). It's the PG_BINARY_R/W/A macros for >>> fopen() that are redundant per POSIX. Possibly someone generalized >>> inappropriately; or maybe long ago we supported some platform that >>> rejected the "b" option? > >> I think the latter was the case. I doubt it's still a problem. > > We could find that out with little effort, at least for machines in the > buildfarm, by modifying c.h to use the form with "b" always. > I think we should also consider the popen() (see: OpenPipeStream() function), on the Windows, it can use "b", however, for linux, it might be not right. So, modifying c.h to use the form with "b" isn't always right. [1] https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/popen-wpopen?view=msvc-170 -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.
В списке pgsql-hackers по дате отправления: