site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com In your case, you could just close the socket in the signal handler. On Nov 24, 2004, at 9:56 AM, Pelle Johansson wrote: _______________________________________________ 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/paulf%40aphrodite.com _______________________________________________ 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... In my experience, it's a lot more reliable to close the socket unless the signal handler exits the process. Taking a sideways exit out of the process is fine for simple things, but gets ugly if you need to cleanly shut things down (like database files), especially if you have threads. If you depend on accept failing with EINTR, the signal may not arrive while blocking on the accept call. If you happen to get the signal just before or after the accept call, you won't notice. Polling a global shutdown flag set in the signal handler still doesn't help because you may get the signal after checking the flag but before blocking in the accept call. Send the process a signal you are catching, the system call will then interrupt and return. -- Pelle Johansson <morth@morth.org> This email sent to paulf@aphrodite.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Paul Forgey