Add check and use sigaction, fix bug signal_s define and type compare warnning.