replaced signal with sigaction

Replaced signal(2) with sigaction(2) as is recommended in the
man page for signal(2).