pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Use STDOUT/STDERR_FILENO in most of syslogger.
2+ messages / 1 participants
[nested] [flat]

* pgsql: Use STDOUT/STDERR_FILENO in most of syslogger.
@ 2022-07-19 00:53 Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Andres Freund @ 2022-07-19 00:53 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Use STDOUT/STDERR_FILENO in most of syslogger.
@ 2022-07-19 00:53 Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Andres Freund @ 2022-07-19 00:53 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/c91a216ef7385e78e7eb80355c4d02953711bdba

Modified Files
--------------
src/backend/postmaster/syslogger.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2022-07-19 00:53 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-07-19 00:53 pgsql: Use STDOUT/STDERR_FILENO in most of syslogger. Andres Freund <andres@anarazel.de>
2022-07-19 00:53 pgsql: Use STDOUT/STDERR_FILENO in most of syslogger. Andres Freund <andres@anarazel.de>

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