public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: Sehrope Sarkuni <[email protected]>
Cc: Pg Hackers <[email protected]>
Cc: [email protected]
Subject: Re: Add jsonlog log_destination for JSON server logs
Date: Wed, 29 Sep 2021 11:02:10 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <CAH7T-aqW0_yxuqznFkQbjdZz1ck+96Q2HzZHki6dsQbVHxzEPw@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CAH7T-areunm7CBDMLo8jMJ1fs=87eTqRmKOAY6CoEkexfdxEaQ@mail.gmail.com>
	<[email protected]>
	<CAH7T-apxdwf7=CHD_Vuo+QgtV6TEnLc0N0_SMTJ-a-jFdOBOvA@mail.gmail.com>
	<[email protected]>
	<CAH7T-aqkmrCEpTqvwUOWNATitWCnPPf3M75+af8c4afMEbMepQ@mail.gmail.com>
	<[email protected]>

On Tue, Sep 28, 2021 at 12:30:10PM +0900, Michael Paquier wrote:
> 0001 is in a rather commitable shape, and I have made the code
> consistent with HEAD.  However, I think that its handling of
> _get_osfhandle() is clunky for 64-bit compilations as long is 32b in
> WIN32 but intptr_t is platform-dependent as it could be 32b or 64b, so
> atoi() would overflow if the handle is larger than INT_MAX for 64b
> builds:
> https://docs.microsoft.com/en-us/cpp/c-runtime-library/standard-types
> This problem deserves a different thread.

This happens to not be a problem as only 32 bits are significant for
handles for both Win32 and Win64.  This also means that we should be
able to remove the use for "long" in this code, making the routines
more symmetric.  I have done more tests with Win32 and Win64, and
applied it.  I don't have MinGW environments at hand, but looking at
the upstream code that should not matter.  The buildfarm will let
us know soon enough if there is a problem thanks to the TAP tests of
pg_ctl.
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../[email protected]/2-signature.asc)
  download

view thread (27+ messages)  latest in thread

reply

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Add jsonlog log_destination for JSON server logs
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox