all repos — fluxbox @ ec7d792a484e6882118caa34521ffb8b23fa871b

custom fork of the fluxbox windowmanager

minor fixes
fluxgen fluxgen
commit

ec7d792a484e6882118caa34521ffb8b23fa871b

parent

4880851f132fc3874c5bb01db2f68bc66320063c

1 files changed, 14 insertions(+), 8 deletions(-)

jump to
M src/tests/signaltest.ccsrc/tests/signaltest.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -#include "../SignalHandler.hh" +#include "../FbTk/SignalHandler.hh" #include <iostream> #include <cassert>

@@ -27,7 +27,7 @@

using namespace std; using namespace FbTk; -class IntSig:public SignalHandler::EventHandler { +class IntSig:public SignalEventHandler { public: void handleSignal(int signum) { assert(signum == SIGINT);

@@ -36,10 +36,13 @@ exit(0);

} }; -class AllSig:public SignalHandler::EventHandler { +class AllSig:public SignalEventHandler { public: void handleSignal(int signum) { switch (signum) { + case SIGSEGV: + cerr<<"SIGSEGV"; + break; case SIGTERM: cerr<<"SIGTERM"; break;

@@ -59,14 +62,17 @@ }

}; int main(int argc, char **argv) { - SignalHandler *sigh = SignalHandler::instance(); + SignalHandler &sigh = SignalHandler::instance(); + IntSig handler; AllSig allhand; - sigh->registerHandler(SIGINT, &handler); - sigh->registerHandler(SIGTERM, &allhand); - sigh->registerHandler(SIGUSR1, &allhand); - sigh->registerHandler(SIGUSR2, &allhand); + sigh.registerHandler(SIGINT, &handler); + sigh.registerHandler(SIGSEGV, &allhand); + sigh.registerHandler(SIGTERM, &allhand); + sigh.registerHandler(SIGUSR1, &allhand); + sigh.registerHandler(SIGUSR2, &allhand); + cerr<<"Send signals to me :)"<<endl; while (1) {