Use sigaction instead of signal so it can bre re-entered