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

Commitf316222

Browse files
committed
Fix erroneous Assert() in syslogger process start in EXEC_BACKEND case,
per ITAGAKI Takahiro. Also, rewrite syslogger_forkexec() in hopes ofeliminating the confusion in the first place.
1 parentbbda96d commitf316222

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

‎src/backend/postmaster/syslogger.c

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*
1919
*
2020
* IDENTIFICATION
21-
* $PostgreSQL: pgsql/src/backend/postmaster/syslogger.c,v 1.39 2007/09/20 18:19:08 adunstan Exp $
21+
* $PostgreSQL: pgsql/src/backend/postmaster/syslogger.c,v 1.40 2007/09/22 18:19:18 tgl Exp $
2222
*
2323
*-------------------------------------------------------------------------
2424
*/
@@ -608,10 +608,8 @@ static pid_t
608608
syslogger_forkexec(void)
609609
{
610610
char*av[10];
611-
intac=0,
612-
bufc=0,
613-
i;
614-
charnumbuf[2][32];
611+
intac=0;
612+
charfilenobuf[32];
615613

616614
av[ac++]="postgres";
617615
av[ac++]="--forklog";
@@ -620,21 +618,18 @@ syslogger_forkexec(void)
620618
/* static variables (those not passed by write_backend_variables) */
621619
#ifndefWIN32
622620
if (syslogFile!=NULL)
623-
snprintf(numbuf[bufc++],32,"%d",fileno(syslogFile));
621+
snprintf(filenobuf,sizeof(filenobuf),"%d",
622+
fileno(syslogFile));
624623
else
625-
strcpy(numbuf[bufc++],"-1");
624+
strcpy(filenobuf,"-1");
626625
#else/* WIN32 */
627626
if (syslogFile!=NULL)
628-
snprintf(numbuf[bufc++],32,"%ld",
627+
snprintf(filenobuf,sizeof(filenobuf),"%ld",
629628
_get_osfhandle(_fileno(syslogFile)));
630629
else
631-
strcpy(numbuf[bufc++],"0");
630+
strcpy(filenobuf,"0");
632631
#endif/* WIN32 */
633-
634-
/* Add to the arg list */
635-
Assert(bufc <=lengthof(numbuf));
636-
for (i=0;i<bufc;i++)
637-
av[ac++]=numbuf[i];
632+
av[ac++]=filenobuf;
638633

639634
av[ac]=NULL;
640635
Assert(ac<lengthof(av));
@@ -652,7 +647,7 @@ syslogger_parseArgs(int argc, char *argv[])
652647
{
653648
intfd;
654649

655-
Assert(argc==5);
650+
Assert(argc==4);
656651
argv+=3;
657652

658653
#ifndefWIN32

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp