Not all platforms supports sighandler_t, so I changed it to use the older