From: Michael Paquier <michael@paquier.xyz>
To: Juan José Santamaría Flecha <juanjo.santamaria@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Emil Iggland <emil@iggland.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: BUG #15858: could not stat file - over 4GB
Date: Sat, 10 Oct 2020 21:23:53 +0900
Message-ID: <20201010122353.GA2985@paquier.xyz> (raw)
In-Reply-To: <CAC+AXB0g44SbvSpC86o_1HWh8TAU2pZrMRW6tJT-dkijotx5Qg@mail.gmail.com>
References: <15858-9572469fd3b73263@postgresql.org>
<CAC+AXB2164H1JjSOPwf=PK5AhRVHSApzC5NAU-443HSu7RotSA@mail.gmail.com>
<160209800917.1171.12856112208955258625.pgcf@coridan.postgresql.org>
<2831747.1602274940@sss.pgh.pa.us>
<CAC+AXB0g44SbvSpC86o_1HWh8TAU2pZrMRW6tJT-dkijotx5Qg@mail.gmail.com>
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
Attachments:
[application/pgp-signature] signature.asc (832B, ../20201010122353.GA2985@paquier.xyz/2-signature.asc)
download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: michael@paquier.xyz, juanjo.santamaria@gmail.com, tgl@sss.pgh.pa.us, emil@iggland.com, pgsql-hackers@lists.postgresql.org
Subject: Re: BUG #15858: could not stat file - over 4GB
In-Reply-To: <20201010122353.GA2985@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox