Re: Fix fseek() detection of unseekable files on WIN32

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Fix fseek() detection of unseekable files on WIN32
Дата
Msg-id ZBJrcBD3P5Lp4JiB@paquier.xyz
обсуждение исходный текст
Ответ на Re: Fix fseek() detection of unseekable files on WIN32  (Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>)
Ответы Re: Fix fseek() detection of unseekable files on WIN32  (Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>)
Список pgsql-hackers
On Wed, Mar 15, 2023 at 12:18:25PM +0100, Juan José Santamaría Flecha wrote:
> PFA a new version of the patch.

+_pgftello64(FILE *stream)
+{
+   DWORD           fileType;
+
+   fileType = GetFileType((HANDLE) _get_osfhandle(_fileno(stream)));

Hmm.  I am a bit surprised here..  It seems to me that we should make
sure that:
- We exist quickly if _get_osfhandle() returns -2 or
INVALID_HANDLE_VALUE, returning EINVAL?
- After GetFileType(), check for GetLastError() and the
FILE_TYPE_UNKNOWN case?

Do you think that these would be improvements?
--
Michael

Вложения

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

Предыдущее
От: Melanie Plageman
Дата:
Сообщение: Re: Option to not use ringbuffer in VACUUM, using it in failsafe mode
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: recovery modules