Tom Lane wrote:
> Bruce Momjian <[EMAIL PROTECTED]> writes:
> > Is running the rest of the
> > application with SIGPIPE <= SIG_IGN a problem?
> 
> That is NOT an acceptable thing for a library to do.

Yes, I was afraid of that.  Here's another idea.  If the signal handler
is SIG_DFL, we install our own signal handler for SIGPIPE, and set/clear a
global variable before/after we send().  When our signal handler is
called, we check to see if our global variable is set, and we either
ignore or exit().  Can we do that safely?  Seems it only fails when they
register a signal handler after establishing a database connection.

How would this work in a threaded app --- not too well, I think.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [EMAIL PROTECTED]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to