Use sigaction instead deprecated signal.
GP: Reduce optimization's steps.