Re: SIGPIPE handling, take two. - Mailing list pgsql-patches

From Manfred Spraul
Subject Re: SIGPIPE handling, take two.
Date
Msg-id 3FB11AE5.2060707@colorfullife.com
Whole thread Raw
In response to Re: SIGPIPE handling, take two.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: SIGPIPE handling, take two.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
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


pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: SIGPIPE handling, take two.
Next
From: Tom Lane
Date:
Subject: Re: SIGPIPE handling, take two.