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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Juan José Santamaría Flecha <juanjo(dot)santamaria(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Emil Iggland <emil(at)iggland(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #15858: could not stat file - over 4GB
Date: 2020-10-10 12:23:53
Message-ID: 20201010122353.GA2985@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Juan José Santamaría Flecha 2020-10-10 14:29:38 Re: BUG #15858: could not stat file - over 4GB
Previous Message Pavel Stehule 2020-10-10 11:55:25 Re: BUG #16665: Segmentation fault

Browse pgsql-hackers by date

  From Date Subject
Next Message Juan José Santamaría Flecha 2020-10-10 14:29:38 Re: BUG #15858: could not stat file - over 4GB
Previous Message David Christensen 2020-10-10 12:16:47 Re: [PATCH] Add `truncate` option to subscription commands