Here's the core of the logger subprocess.

- no rotation code so far, all syslogFile handling is for testing only
- send_message_to_serverlog needs some careful handling of stderr, in 
case pipe writing fails or if after a log process restart redirecting 
stderr fails. In these cases, the original stderr should be used.

While looking at pgstat.c to see how to peek for pipe data, I found
	readpipe=pgStatPipe[0];
	select(readPipe+1, ..);

which is probably usually the same as select(pgStatPipe[1], ..) This fd 
arithmetics seem a bit dubious to me.

Regards,
Andreas
Thu, 15 Jul 2004 21:00:50 +0200
Andreas Pflug <pgadmin@pse-consulting.de>
SysLogger subprocess
On Thu, Jul 15, 2004 at 09:00:50PM +0200, Andreas Pflug wrote:

> While looking at pgstat.c to see how to peek for pipe data, I found
> 	readpipe=pgStatPipe[0];
> 	select(readPipe+1, ..);
> 
> which is probably usually the same as select(pgStatPipe[1], ..) This fd 
> arithmetics seem a bit dubious to me.

No, it's not pgStatPipe[1], it's select(2)'s first argument; max fd in
the sets plus one.  Probably your code works because
pgStatPipe[1] == pgStatPipe[0] + 1.

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Por suerte hoy explotï¿½ el califont porque si no me habrï¿½a muerto
de aburrido"  (Papelucho)


Thu, 15 Jul 2004 15:36:04 -0400
Alvaro Herrera <alvherre@dcc.uchile.cl>
Re: SysLogger subprocess
Alvaro Herrera wrote:
> 
> No, it's not pgStatPipe[1], it's select(2)'s first argument; max fd in
> the sets plus one.  Probably your code works because
> pgStatPipe[1] == pgStatPipe[0] + 1.

Ah, I see now, thanks.

Regards,
Andreas


Thu, 15 Jul 2004 22:25:31 +0200
Andreas Pflug <pgadmin@pse-consulting.de>
Re: SysLogger subprocess