version 1.330, 2022/02/08 08:59:12 |
version 1.331, 2023/01/06 02:39:59 |
|
|
} |
} |
|
|
static void |
static void |
session_close_single_x11(struct ssh *ssh, int id, void *arg) |
session_close_single_x11(struct ssh *ssh, int id, int force, void *arg) |
{ |
{ |
Session *s; |
Session *s; |
u_int i; |
u_int i; |
|
|
* the session 'child' itself dies |
* the session 'child' itself dies |
*/ |
*/ |
void |
void |
session_close_by_channel(struct ssh *ssh, int id, void *arg) |
session_close_by_channel(struct ssh *ssh, int id, int force, void *arg) |
{ |
{ |
Session *s = session_by_channel(id); |
Session *s = session_by_channel(id); |
u_int i; |
u_int i; |
|
|
if (s->pid != 0) { |
if (s->pid != 0) { |
debug_f("channel %d: has child, ttyfd %d", id, s->ttyfd); |
debug_f("channel %d: has child, ttyfd %d", id, s->ttyfd); |
/* |
/* |
* delay detach of session, but release pty, since |
* delay detach of session (unless this is a forced close), |
* the fd's to the child are already closed |
* but release pty, since the fd's to the child are already |
|
* closed |
*/ |
*/ |
if (s->ttyfd != -1) |
if (s->ttyfd != -1) |
session_pty_cleanup(s); |
session_pty_cleanup(s); |
return; |
if (!force) |
|
return; |
} |
} |
/* detach by removing callback */ |
/* detach by removing callback */ |
channel_cancel_cleanup(ssh, s->chanid); |
channel_cancel_cleanup(ssh, s->chanid); |