[Libevent-users] Problems handling sigpipe in multithreaded program

Ron Arts ron.arts at neonova.nl
Mon Apr 7 09:07:34 EDT 2008


Hi all,

I am having problems with sigpipe handling.
According to what I've read, if I ignore pipe signals
before creating threads, all created threads will
inherit this setting and ignore the sigpipes as well.

My program's main thread uses libevent like this:


   sa.sa_handler = SIG_IGN;
   sa.sa_flags   = 0;
   sigemptyset(&sa.sa_mask);
   sigaction(SIGPIPE, &sa, NULL);

   // libraries
   event_init();
   g_thread_init(NULL);

   //create threads here
   fork();
   event_dispatch();

But I still get occasional SIGPIPE errors which kill
my program. These always happen in bufferevent_write,


What can I do to solve this?

Thanks,
Ron

-- 
NeoNova BV, The Netherlands
Professional internet and VoIP solutions

http://www.neonova.nl   Kruislaan 419              1098 VA Amsterdam
info: 020-5628292       servicedesk: 020-5628292   fax: 020-5628291
KvK Amsterdam 34151241

The following disclaimer applies to this email:
http://www.neonova.nl/maildisclaimer


More information about the Libevent-users mailing list