From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use STDOUT/STDERR_FILENO in most of syslogger.
Date: Tue, 19 Jul 2022 00:53:47 +0000
Message-ID: <E1oDbUg-000C9b-FX@gemulon.postgresql.org> (raw)
Use STDOUT/STDERR_FILENO in most of syslogger.
This fixes problems on windows when logging collector is used in a service,
failing with:
FATAL: could not redirect stderr: Bad file descriptor
This is triggered by 76e38b37a5. The problem is that STDOUT/STDERR_FILENO
aren't defined on windows, which lead us to use _fileno(stdout) etc, but that
doesn't work if stdout/stderr are closed.
Author: Andres Freund <andres@anarazel.de>
Reported-By: Sandeep Thakkar <sandeep.thakkar@enterprisedb.com>
Message-Id: 20220520164558.ozb7lm6unakqzezi@alap3.anarazel.de (on pgsql-packagers)
Backpatch: 15-, where 76e38b37a5 came in
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/950e64fa46b164df87b5eb7c6e15213ab9880f87
Modified Files
--------------
src/backend/postmaster/syslogger.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: andres@anarazel.de
Subject: Re: pgsql: Use STDOUT/STDERR_FILENO in most of syslogger.
In-Reply-To: <E1oDbUg-000C9b-FX@gemulon.postgresql.org>
References: <E1oDbUg-000C9b-FX@gemulon.postgresql.org>
* 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