Tom Lane wrote:
>Bruce Momjian <pgman@candle.pha.pa.us> writes:
>
>
>>I think this is the patch I like.
>>
>>
>
>The #if coding is messy and unnecessary. You could do the test as per
>the non-POSIX variant using two calls of pqsignal(), and not have any
>system dependence here, nor a need for <signal.h>.
>
>
What about multithreaded apps?
old = pgsignal(SIPEPIPE, SIG_IGN);
** another thread calls sigaction(SIGPIPE,,);
pgsignal(SIGPIPE, old);
And the signal state is corrupted. What about extending pgsignal:
pgsignal(signo, SIG_ERR);
reads the current signal handler. I'll update my patch.
From your other mail:
>No, because this patch does not have any global effect on the signal
>handling. It might be unnecessary to check per-connection, but it
>doesn't hurt, and on grounds of cleanliness I'd prefer to avoid a global
>variable.
>
>
I agree - global state would require global synchronization.
--
Manfred