mirror of
https://github.com/clearml/dropbear
synced 2025-03-05 11:38:53 +00:00
Move comment to svr_chansess_checksignal() where it belongs
This commit is contained in:
parent
661d8ca225
commit
cc59c08605
@ -82,6 +82,14 @@ static int sesscheckclose(const struct Channel *channel) {
|
||||
return chansess->exit.exitpid != -1;
|
||||
}
|
||||
|
||||
/* Handler for childs exiting, store the state for return to the client */
|
||||
|
||||
/* There's a particular race we have to watch out for: if the forked child
|
||||
* executes, exits, and this signal-handler is called, all before the parent
|
||||
* gets to run, then the childpids[] array won't have the pid in it. Hence we
|
||||
* use the svr_ses.lastexit struct to hold the exit, which is then compared by
|
||||
* the parent when it runs. This work correctly at least in the case of a
|
||||
* single shell spawned (ie the usual case) */
|
||||
void svr_chansess_checksignal(void) {
|
||||
int status;
|
||||
pid_t pid;
|
||||
@ -127,18 +135,9 @@ void svr_chansess_checksignal(void) {
|
||||
/* we use this to determine how pid exited */
|
||||
ex->exitsignal = -1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* Handler for childs exiting, store the state for return to the client */
|
||||
|
||||
/* There's a particular race we have to watch out for: if the forked child
|
||||
* executes, exits, and this signal-handler is called, all before the parent
|
||||
* gets to run, then the childpids[] array won't have the pid in it. Hence we
|
||||
* use the svr_ses.lastexit struct to hold the exit, which is then compared by
|
||||
* the parent when it runs. This work correctly at least in the case of a
|
||||
* single shell spawned (ie the usual case) */
|
||||
static void sesssigchild_handler(int UNUSED(dummy)) {
|
||||
struct sigaction sa_chld;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user