|
Lines 177-182
Link Here
|
| 177 |
|
177 |
|
| 178 |
int error_count; |
178 |
int error_count; |
| 179 |
|
179 |
|
|
|
180 |
sigset_t ignored_signals; /* to be ignored due to kill_my_pg() call */ |
| 181 |
|
| 180 |
/* |
182 |
/* |
| 181 |
* We maintain a list of child process pids and |
183 |
* We maintain a list of child process pids and |
| 182 |
* functions to call when they exit. |
184 |
* functions to call when they exit. |
|
Lines 217-223
Link Here
|
| 217 |
static void cleanup_db __P((void)); |
219 |
static void cleanup_db __P((void)); |
| 218 |
#endif |
220 |
#endif |
| 219 |
|
221 |
|
| 220 |
static void handle_events __P((void)); |
|
|
| 221 |
static void print_link_stats __P((void)); |
222 |
static void print_link_stats __P((void)); |
| 222 |
|
223 |
|
| 223 |
extern char *ttyname __P((int)); |
224 |
extern char *ttyname __P((int)); |
|
Lines 644-650
Link Here
|
| 644 |
/* |
647 |
/* |
| 645 |
* handle_events - wait for something to happen and respond to it. |
648 |
* handle_events - wait for something to happen and respond to it. |
| 646 |
*/ |
649 |
*/ |
| 647 |
static void |
650 |
void |
| 648 |
handle_events() |
651 |
handle_events() |
| 649 |
{ |
652 |
{ |
| 650 |
struct timeval timo; |
653 |
struct timeval timo; |
|
Lines 767-772
Link Here
|
| 767 |
* be sufficient. |
770 |
* be sufficient. |
| 768 |
*/ |
771 |
*/ |
| 769 |
signal(SIGPIPE, SIG_IGN); |
772 |
signal(SIGPIPE, SIG_IGN); |
|
|
773 |
|
| 774 |
sigemptyset(&ignored_signals); |
| 770 |
} |
775 |
} |
| 771 |
|
776 |
|
| 772 |
/* |
777 |
/* |
|
Lines 1334-1346
Link Here
|
| 1334 |
kill_my_pg(sig) |
1339 |
kill_my_pg(sig) |
| 1335 |
int sig; |
1340 |
int sig; |
| 1336 |
{ |
1341 |
{ |
| 1337 |
struct sigaction act, oldact; |
1342 |
if (sigismember(&ignored_signals, sig)) |
| 1338 |
|
1343 |
{ |
| 1339 |
act.sa_handler = SIG_IGN; |
1344 |
sigdelset(&ignored_signals, sig); |
| 1340 |
act.sa_flags = 0; |
1345 |
} |
| 1341 |
sigaction(sig, &act, &oldact); |
1346 |
else |
| 1342 |
kill(0, sig); |
1347 |
{ |
| 1343 |
sigaction(sig, &oldact, NULL); |
1348 |
sigaddset(&ignored_signals, sig); |
|
|
1349 |
kill(0, sig); |
| 1350 |
} |
| 1344 |
} |
1351 |
} |
| 1345 |
|
1352 |
|
| 1346 |
|
1353 |
|
|
Lines 1382-1387
Link Here
|
| 1382 |
/* Send the signal to the [dis]connector process(es) also */ |
1389 |
/* Send the signal to the [dis]connector process(es) also */ |
| 1383 |
kill_my_pg(sig); |
1390 |
kill_my_pg(sig); |
| 1384 |
notify(sigreceived, sig); |
1391 |
notify(sigreceived, sig); |
|
|
1392 |
status = EXIT_USER_REQUEST; |
| 1385 |
if (waiting) |
1393 |
if (waiting) |
| 1386 |
siglongjmp(sigjmp, 1); |
1394 |
siglongjmp(sigjmp, 1); |
| 1387 |
} |
1395 |
} |