site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Hello, all ... // set up our signal handlers signal( SIGINT, signal_handler ); signal( SIGTERM, signal_handler ); #ifndef WIN32 signal( SIGPIPE, SIG_IGN ); #endif Glenn. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... At 4:09 pm -0700 18/6/2007, jmzorko@mac.com wrote: In my adventures of making our app also work on Mac OSX (10.4.9, Intel and PPC), i've discovered that I occasionally get SIGPIPE signals. This would be fine, except that I specifically ignore them like this: ... so my question is: why do I still get SIGPIPE signals, which make my program go boom? What else do I need to do such that SIGPIPE is actually ignored? I don't _always_ get them, but they come up often enough to be a problem. SIGPIPE is a per-thread signal, so you need to do signal( SIGPIPE, SIG_IGN ) on every thread dealing with the relevant sockets. Alternatively you can use setsockopt() with SOL_SOCKET and SO_NOSIGPIPE to turn off SIGPIPE for a socket. This email sent to site_archiver@lists.apple.com
participants (1)
-
Glenn Anderson