Re: [PATCH] O_CLOEXEC not honored on Windows - handle inheritance chain - Mailing list pgsql-hackers

From Bryan Green
Subject Re: [PATCH] O_CLOEXEC not honored on Windows - handle inheritance chain
Date
Msg-id 45ced00e-e6d1-487b-982d-1720418233b8@gmail.com
Whole thread Raw
In response to Re: [PATCH] O_CLOEXEC not honored on Windows - handle inheritance chain  (Thomas Munro <thomas.munro@gmail.com>)
List pgsql-hackers
On 12/12/2025 9:57 PM, Thomas Munro wrote:
> On Sat, Dec 13, 2025 at 3:44 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Thomas Munro <thomas.munro@gmail.com> writes:
>>> Hearing nothing, pushed.
>>
>> fairywren is unimpressed:
>>
>> ../pgsql/src/test/modules/test_cloexec/test_cloexec.c: In function 'run_parent_tests':
>> ../pgsql/src/test/modules/test_cloexec/test_cloexec.c:137:29: warning: unused variable 'space_pos'
[-Wunused-variable]
>>   137 |                 char       *space_pos;
>>       |                             ^~~~~~~~~
> 
> The CI MinGW task also shows this warning, but it doesn't use -Werror.
> The separate CompileWarnings task does, being its purpose, and it
> includes a MinGW cross-build step, but that uses configure, and this
> test is built only by meson.  That wasn't a great idea... we knew we
> were only dealing with Windows but forgot about MinGW, so I'll go and
> write a patch to fix that aspect later today so we're covered for
> warnings.  I'll also think about whether it's worth checking for MinGW
> warnings in both assert and non-assert builds (as we do for regular
> Linux gcc/clang), and I'd also like to try to catch warnings from MSVC
> and had an idea for how to do that...  I might also try to think about
> meson-vs-configure cross checks...
> 
>> What is the point of that first snprintf(cmdline, ...), when its
>> result is guaranteed to be overwritten just below?
>>
>> I'm also dubious about using MAX_PATH here; see the commentary
>> about MAXPGPATH in pg_config_manual.h.  Also, what's the point of
>> using MAX_PATH when the result is going to be transferred into
>> cmdline (with a hardwired size of 1024)?
> 
> Fair points, I'll wait and see if Bryan is free to write a patch on
> Monday (US), and otherwise write one myself.
I will write a patch tonight.  This was my sloppiness from doing
incremental changes and not cleaning up behind myself.  I'll clean it
up.  Thanks for the checks...

-- 
Bryan Green
EDB: https://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: [PATCH] O_CLOEXEC not honored on Windows - handle inheritance chain
Next
From: Bryan Green
Date:
Subject: Re: [PATCH] O_CLOEXEC not honored on Windows - handle inheritance chain