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

From Tom Lane
Subject Re: SIGPIPE handling, take two.
Date
Msg-id 11953.1068574924@sss.pgh.pa.us
Whole thread Raw
In response to Re: SIGPIPE handling, take two.  (Manfred Spraul <manfred@colorfullife.com>)
List pgsql-patches
Manfred Spraul <manfred@colorfullife.com> writes:
> ... But the SIG_IGN/restore
> sequence affects the whole app - PQconnectdb calls would result in
> randomly dropped SIGPIPE signals.

Good point.  AFAICS we lose anyway if we don't have sigaction()
available, but hopefully any multithreaded platform has sigaction().

I still don't like modifying pqsignal's API though.  What I suggest
is adding a function like "pqsignalinquire(signalno)" to pqsignal.c,
defined to return the signal handler without changing it ... that is,
take the system-dependent code you were going to put in fe-connect.c
and put it in pqsignal.c instead.

            regards, tom lane

pgsql-patches by date:

Previous
From: Michael Mauger
Date:
Subject: Re: [HACKERS] Proposal: psql force prompting on notty
Next
From: Bruce Momjian
Date:
Subject: Re: psql: \dg and groups for \du