Re: [PATCHES] Bad bug in fopen() wrapper code

Поиск
Список
Период
Сортировка
От Zeugswetter Andreas DCP SD
Тема Re: [PATCHES] Bad bug in fopen() wrapper code
Дата
Msg-id E1539E0ED7043848906A8FF995BDA579016265A3@m0143.s-mxs.net
обсуждение исходный текст
Ответ на Re: [PATCHES] Bad bug in fopen() wrapper code  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: [PATCHES] Bad bug in fopen() wrapper code  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> Magnus, is this the right fix?

Well, actually msdn states:

"Return Value
 If successful, _setmode returns the previous translation mode. A return
value of -1 indicates an error"

So, shouldn't we be testing for -1 instead of < 0 ?

The thing is probably academic, since _setmode is only supposed to fail
on invalid file handle or invalid mode.
So basically, given our code, it should only fail if filemode is
(O_BINARY | O_TEXT) both flags set.

Andreas

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

Предыдущее
От: Jeremy Drake
Дата:
Сообщение: Re: src/tools/msvc usage instructions
Следующее
От: "Zeugswetter Andreas DCP SD"
Дата:
Сообщение: Re: Faster StrNCpy