My recommendation is to do little more than set a flag in the signal catcher and return. Test this flag at appropriate places in the main program control loop. This is much safer than trying to do anything useful from inside a signal catcher.