pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix pg_current_logfile() to not emit a carriage return on Window 5+ messages / 1 participants [nested] [flat]
* pgsql: Fix pg_current_logfile() to not emit a carriage return on Window @ 2020-07-09 20:03 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2020-07-09 20:03 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix pg_current_logfile() to not emit a carriage return on Windows. Due to not having our signals straight about CRLF vs. LF line termination, the output of pg_current_logfile() included a trailing \r on Windows. To fix, force the file descriptor it uses into text mode. While here, move a couple of local variable declarations to make the function's logic clearer. In v12 and v13, also back-patch the test added by 1c4e88e2f so that this function has some test coverage. However, the 004_logrotate.pl test script doesn't exist before v12, and it didn't seem worth adding to older branches just for this. Per report from Thomas Kellerer. Back-patch to v10 where this function was added. Discussion: https://postgr.es/m/412ae8da-76bb-640f-039a-f3513499e53d@gmx.net Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/183926da3162b1807904710e46882c004beff5fb Modified Files -------------- src/backend/utils/adt/misc.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Fix pg_current_logfile() to not emit a carriage return on Window @ 2020-07-09 20:03 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2020-07-09 20:03 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix pg_current_logfile() to not emit a carriage return on Windows. Due to not having our signals straight about CRLF vs. LF line termination, the output of pg_current_logfile() included a trailing \r on Windows. To fix, force the file descriptor it uses into text mode. While here, move a couple of local variable declarations to make the function's logic clearer. In v12 and v13, also back-patch the test added by 1c4e88e2f so that this function has some test coverage. However, the 004_logrotate.pl test script doesn't exist before v12, and it didn't seem worth adding to older branches just for this. Per report from Thomas Kellerer. Back-patch to v10 where this function was added. Discussion: https://postgr.es/m/412ae8da-76bb-640f-039a-f3513499e53d@gmx.net Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/601d419b2b5def62a1867169e67c7ef876f0b886 Modified Files -------------- src/backend/utils/adt/misc.c | 19 ++++++++++++------- src/bin/pg_ctl/t/004_logrotate.pl | 6 +++++- 2 files changed, 17 insertions(+), 8 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Fix pg_current_logfile() to not emit a carriage return on Window @ 2020-07-09 20:03 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2020-07-09 20:03 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix pg_current_logfile() to not emit a carriage return on Windows. Due to not having our signals straight about CRLF vs. LF line termination, the output of pg_current_logfile() included a trailing \r on Windows. To fix, force the file descriptor it uses into text mode. While here, move a couple of local variable declarations to make the function's logic clearer. In v12 and v13, also back-patch the test added by 1c4e88e2f so that this function has some test coverage. However, the 004_logrotate.pl test script doesn't exist before v12, and it didn't seem worth adding to older branches just for this. Per report from Thomas Kellerer. Back-patch to v10 where this function was added. Discussion: https://postgr.es/m/412ae8da-76bb-640f-039a-f3513499e53d@gmx.net Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/2564e2d08546dfedc1482e10205be58a20ffe3cc Modified Files -------------- src/backend/utils/adt/misc.c | 19 ++++++++++++------- src/bin/pg_ctl/t/004_logrotate.pl | 6 +++++- 2 files changed, 17 insertions(+), 8 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Fix pg_current_logfile() to not emit a carriage return on Window @ 2020-07-09 20:03 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2020-07-09 20:03 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix pg_current_logfile() to not emit a carriage return on Windows. Due to not having our signals straight about CRLF vs. LF line termination, the output of pg_current_logfile() included a trailing \r on Windows. To fix, force the file descriptor it uses into text mode. While here, move a couple of local variable declarations to make the function's logic clearer. In v12 and v13, also back-patch the test added by 1c4e88e2f so that this function has some test coverage. However, the 004_logrotate.pl test script doesn't exist before v12, and it didn't seem worth adding to older branches just for this. Per report from Thomas Kellerer. Back-patch to v10 where this function was added. Discussion: https://postgr.es/m/412ae8da-76bb-640f-039a-f3513499e53d@gmx.net Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/90b418f81645f6a3a4162dad7628481a5d1a7415 Modified Files -------------- src/backend/utils/adt/misc.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Fix pg_current_logfile() to not emit a carriage return on Window @ 2020-07-09 20:03 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 5+ messages in thread From: Tom Lane @ 2020-07-09 20:03 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix pg_current_logfile() to not emit a carriage return on Windows. Due to not having our signals straight about CRLF vs. LF line termination, the output of pg_current_logfile() included a trailing \r on Windows. To fix, force the file descriptor it uses into text mode. While here, move a couple of local variable declarations to make the function's logic clearer. In v12 and v13, also back-patch the test added by 1c4e88e2f so that this function has some test coverage. However, the 004_logrotate.pl test script doesn't exist before v12, and it didn't seem worth adding to older branches just for this. Per report from Thomas Kellerer. Back-patch to v10 where this function was added. Discussion: https://postgr.es/m/412ae8da-76bb-640f-039a-f3513499e53d@gmx.net Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/765ad260a18fc65003ef244b401ef83525ff3da4 Modified Files -------------- src/backend/utils/adt/misc.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) ^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2020-07-09 20:03 UTC | newest] Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-07-09 20:03 pgsql: Fix pg_current_logfile() to not emit a carriage return on Window Tom Lane <tgl@sss.pgh.pa.us> 2020-07-09 20:03 pgsql: Fix pg_current_logfile() to not emit a carriage return on Window Tom Lane <tgl@sss.pgh.pa.us> 2020-07-09 20:03 pgsql: Fix pg_current_logfile() to not emit a carriage return on Window Tom Lane <tgl@sss.pgh.pa.us> 2020-07-09 20:03 pgsql: Fix pg_current_logfile() to not emit a carriage return on Window Tom Lane <tgl@sss.pgh.pa.us> 2020-07-09 20:03 pgsql: Fix pg_current_logfile() to not emit a carriage return on Window Tom Lane <tgl@sss.pgh.pa.us>
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