From: stephan b. <st...@s1...> - 2005-02-27 17:21:49
|
Hiya! i just corrected a missing var in SimpleApp and came across this code: #ifdef SIGTERM ::signal(SIGTERM, &signalHandler); #endif #ifdef SIGQUIT ::signal(SIGQUIT, &signalHandler); #endif #ifdef SIGINT ::signal(SIGINT, &signalHandler); #endif Coincidentally... please take a look at the attached class. It greatly simplifies/safe-ifies this type of manipulation, and is EASY to use. If it's okay with you i'll put it in the tree (or you can). Where should it go (in App or System?). ---------- Forwarded Message ---------- Subject: you ever work with C signals? Date: Sunday 27 February 2005 14:31 From: stephan beal <st...@s1...> To: James McCann <jm...@es...> Last night i came up with a handy little class for embedding C signal handlers in different scopes. It wraps up a signal handler for a given scope and then restores it to the original when it goes out of scope. This allowed me to easily solve most/all of the ctrl-c problems in teeny because i can more easily block of one specific block for signal handling without having to care about existing handlers. It doesn't inherently have any longjmp support, but i'm not yet sure if a) it needs it and b) that can be generically handled in a class like this. Attached - a standalone file suitable for inclusion in your projects... -- ----- st...@s1... http://s11n.net "...pleasure is a grace and is not obedient to the commands of the will." -- Alan W. Watts |