Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit91ba4cc

Browse files
committed
> > Looking some more, I found some other places that need a space (I
> > suspect...), so here is an updated patch.>> This seems like the wrong way to go about it, because anytime anyone> changes any elog output anywhere, we'll risk another failure. If> syslog can't cope with empty lines, I think the right fix is for the> output-to-syslog routine to change the data just before sending ---> then there is only one place to fix. See the syslog output routine in> src/backend/utils/error/elog.c.Makes sense. Here's a new patch, now the output even looks better:Larry Rosenman
1 parentd5d23dd commit91ba4cc

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

‎src/backend/utils/error/elog.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.67 2000/11/14 19:13:27 petere Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/error/elog.c,v 1.68 2000/11/25 04:38:00 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -657,7 +657,8 @@ write_syslog(int level, const char *line)
657657
seq++;
658658

659659
/* divide into multiple syslog() calls if message is too long */
660-
if (len>PG_SYSLOG_LIMIT)
660+
/* or if the message contains embedded NewLine(s) '\n' */
661+
if (len>PG_SYSLOG_LIMIT||strchr(line,'\n')!=NULL )
661662
{
662663
staticcharbuf[PG_SYSLOG_LIMIT+1];
663664
intchunk_nr=0;
@@ -667,9 +668,17 @@ write_syslog(int level, const char *line)
667668
{
668669
intl;
669670
inti;
671+
/* if we start at a newline, move ahead one char */
672+
if (line[0]=='\n')
673+
{
674+
line++;
675+
len--;
676+
}
670677

671678
strncpy(buf,line,PG_SYSLOG_LIMIT);
672679
buf[PG_SYSLOG_LIMIT]='\0';
680+
if (strchr(buf,'\n')!=NULL)
681+
*strchr(buf,'\n')='\0';
673682

674683
l=strlen(buf);
675684
#ifdefMULTIBYTE

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp