103
103
sigemptyset(&new_action.sa_mask);
104
104
sigaddset(&new_action.sa_mask, SIGINT);
105
106
sigaddset(&new_action.sa_mask, SIGHUP);
106
107
sigaddset(&new_action.sa_mask, SIGTERM);
107
108
sigaction(SIGINT, NULL, &old_action);
108
109
if (old_action.sa_handler != SIG_IGN)
109
110
sigaction(SIGINT, &new_action, NULL);
110
114
sigaction(SIGHUP, NULL, &old_action);
111
115
if (old_action.sa_handler != SIG_IGN)
112
116
sigaction(SIGHUP, &new_action, NULL);