|
Lines 89-94
static int client_alive_timeouts = 0;
Link Here
|
| 89 |
*/ |
89 |
*/ |
| 90 |
|
90 |
|
| 91 |
static volatile sig_atomic_t child_terminated = 0; /* The child has terminated. */ |
91 |
static volatile sig_atomic_t child_terminated = 0; /* The child has terminated. */ |
|
|
92 |
static volatile sig_atomic_t received_sigterm = 0; |
| 92 |
|
93 |
|
| 93 |
/* prototypes */ |
94 |
/* prototypes */ |
| 94 |
static void server_init_dispatch(void); |
95 |
static void server_init_dispatch(void); |
|
Lines 151-156
sigchld_handler(int sig)
Link Here
|
| 151 |
errno = save_errno; |
152 |
errno = save_errno; |
| 152 |
} |
153 |
} |
| 153 |
|
154 |
|
|
|
155 |
static void |
| 156 |
sigterm_handler(int sig) |
| 157 |
{ |
| 158 |
received_sigterm = 1; |
| 159 |
} |
| 160 |
|
| 154 |
/* |
161 |
/* |
| 155 |
* Make packets from buffered stderr data, and buffer it for sending |
162 |
* Make packets from buffered stderr data, and buffer it for sending |
| 156 |
* to the client. |
163 |
* to the client. |
|
Lines 501-506
server_loop(pid_t pid, int fdin_arg, int
Link Here
|
| 501 |
/* Initialize the SIGCHLD kludge. */ |
508 |
/* Initialize the SIGCHLD kludge. */ |
| 502 |
child_terminated = 0; |
509 |
child_terminated = 0; |
| 503 |
mysignal(SIGCHLD, sigchld_handler); |
510 |
mysignal(SIGCHLD, sigchld_handler); |
|
|
511 |
mysignal(SIGTERM, sigterm_handler); |
| 504 |
|
512 |
|
| 505 |
/* Initialize our global variables. */ |
513 |
/* Initialize our global variables. */ |
| 506 |
fdin = fdin_arg; |
514 |
fdin = fdin_arg; |
|
Lines 629-634
server_loop(pid_t pid, int fdin_arg, int
Link Here
|
| 629 |
wait_until_can_do_something(&readset, &writeset, &max_fd, |
637 |
wait_until_can_do_something(&readset, &writeset, &max_fd, |
| 630 |
&nalloc, max_time_milliseconds); |
638 |
&nalloc, max_time_milliseconds); |
| 631 |
|
639 |
|
|
|
640 |
if (received_sigterm) |
| 641 |
cleanup_exit(255); |
| 642 |
|
| 632 |
/* Process any channel events. */ |
643 |
/* Process any channel events. */ |
| 633 |
channel_after_select(readset, writeset); |
644 |
channel_after_select(readset, writeset); |
| 634 |
|
645 |
|