version 1.306, 2018/10/02 12:40:07 |
version 1.307, 2018/10/04 00:10:11 |
|
|
session_pty_cleanup2(Session *s) |
session_pty_cleanup2(Session *s) |
{ |
{ |
if (s == NULL) { |
if (s == NULL) { |
error("session_pty_cleanup: no session"); |
error("%s: no session", __func__); |
return; |
return; |
} |
} |
if (s->ttyfd == -1) |
if (s->ttyfd == -1) |
return; |
return; |
|
|
debug("session_pty_cleanup: session %d release %s", s->self, s->tty); |
debug("%s: session %d release %s", __func__, s->self, s->tty); |
|
|
/* Record that the user has logged out. */ |
/* Record that the user has logged out. */ |
if (s->pid != 0) |
if (s->pid != 0) |
|
|
} |
} |
debug("%s: channel %d child %ld", __func__, id, (long)s->pid); |
debug("%s: channel %d child %ld", __func__, id, (long)s->pid); |
if (s->pid != 0) { |
if (s->pid != 0) { |
debug("%s: channel %d: has child", __func__, id); |
debug("%s: channel %d: has child, ttyfd %d", |
|
__func__, id, s->ttyfd); |
/* |
/* |
* delay detach of session, but release pty, since |
* delay detach of session, but release pty, since |
* the fd's to the child are already closed |
* the fd's to the child are already closed |