Re: BUG #15858: could not stat file - over 4GB

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: BUG #15858: could not stat file - over 4GB
Дата
Msg-id 20201010122353.GA2985@paquier.xyz
обсуждение исходный текст
Ответ на Re: BUG #15858: could not stat file - over 4GB  (Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>)
Ответы Re: BUG #15858: could not stat file - over 4GB  (Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>)
Список pgsql-hackers
On Sat, Oct 10, 2020 at 01:31:21PM +0200, Juan José Santamaría Flecha wrote:
> Thanks for taking care of this. I see no problems in the build farm, but
> please reach me if I missed something.

Thanks for continuing your work on this patch.  I see no related
failures in the buildfarm.

-               _dosmaperr(GetLastError());
+               DWORD           err = GetLastError();
+
+               /* report when not ERROR_SUCCESS */
+               if (err == ERROR_FILE_NOT_FOUND || err == ERROR_PATH_NOT_FOUND)
+                       errno = ENOENT;
+               else
+                       _dosmaperr(err);
Why are you changing that?  The original coding is fine, as
_dosmaperr() already maps ERROR_FILE_NOT_FOUND and
ERROR_PATH_NOT_FOUND to ENOENT.

-      _dosmaperr(GetLastError());
+      DWORD           err = GetLastError();
+
       CloseHandle(hFile);
+      _dosmaperr(err);
These parts are indeed incorrect.  CloseHandle() could overwrite
errno.
--
Michael

Вложения

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

Предыдущее
От: David Christensen
Дата:
Сообщение: Re: [PATCH] Add `truncate` option to subscription commands
Следующее
От: Juan José Santamaría Flecha
Дата:
Сообщение: Re: BUG #15858: could not stat file - over 4GB