Bruce Momjian <[EMAIL PROTECTED]> writes:What about multithreaded apps?
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>.
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 signalI agree - global state would require global synchronization.
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.
-- Manfred
---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend