- new_action.sa_handler = ctrl_c_handler;
- sigemptyset (&new_action.sa_mask);
- new_action.sa_flags = 0;
+ ctrl_c_action.sa_handler = ctrl_c_handler;
+ sigemptyset (&ctrl_c_action.sa_mask);
+ ctrl_c_action.sa_flags = 0;
+
+ sigaction (SIGINT, &ctrl_c_action, NULL);
+
+ // SIGALRM
+ if (pid != 0) {
+ look_child_action.sa_handler = look_child_handler;
+ sigemptyset (&look_child_action.sa_mask);
+ look_child_action.sa_flags = 0;
+
+ sigaction (SIGALRM, &look_child_action, NULL);
+ }