[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql
Subject:    Re: libmysql setting it's own signal handlers?
From:       Sasha Pachev <sasha () surveyz ! com>
Date:       2004-04-30 3:16:28
Message-ID: 4091C50C.2080305 () surveyz ! com
[Download RAW message or body]

Joshua J. Kugler wrote:
> I have a program that is using (via a front end library) libmysql.  If I set 
> up a signal handler before I initialize libmysql, my signal handler is not 
> called when that signal is sent to the process.  If I move the line of code 
> that sets the signal handler to *after* the line that initializes libmysql, 
> my signal handler works fine.
> 
> What does libmysql do to the signal handlers when it initializes?  I don't 
> have the source for it in front of my, or I would probably go digging my 
> self.  Running up against a deadline as it is. :)

mysql client library traps SIGPIPE to deal with some weird threading issues. The 
problem is that is some cases, a threaded program might get a spurious SIGPIPE, 
and then the program crashes if it is not handled. What you are doing should be 
just fine - all that happens inside is that SIGPIPE is ignored. The only problem 
is if you really want to handle SIGPIPE while in the middle of a mysql call. In 
that case, recomple the client without --enable-thread-safe-client or hack the 
source.

-- 
Sasha Pachev
Create online surveys at http://www.surveyz.com/

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=mysql@progressive-comp.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic