version 1.31, 2003/08/28 12:54:34 |
version 1.32, 2003/09/23 20:17:11 |
|
|
extern struct monitor *pmonitor; |
extern struct monitor *pmonitor; |
extern Buffer input, output; |
extern Buffer input, output; |
|
|
|
int |
|
mm_is_monitor(void) |
|
{ |
|
/* |
|
* m_pid is only set in the privileged part, and |
|
* points to the unprivileged child. |
|
*/ |
|
return (pmonitor->m_pid > 0); |
|
} |
|
|
void |
void |
mm_request_send(int socket, enum monitor_reqtype type, Buffer *m) |
mm_request_send(int socket, enum monitor_reqtype type, Buffer *m) |
{ |
{ |
|
|
res = atomicio(read, socket, buf, sizeof(buf)); |
res = atomicio(read, socket, buf, sizeof(buf)); |
if (res != sizeof(buf)) { |
if (res != sizeof(buf)) { |
if (res == 0) |
if (res == 0) |
fatal_cleanup(); |
cleanup_exit(255); |
fatal("%s: read: %ld", __func__, (long)res); |
fatal("%s: read: %ld", __func__, (long)res); |
} |
} |
msg_len = GET_32BIT(buf); |
msg_len = GET_32BIT(buf); |
|
|
} |
} |
|
|
void |
void |
mm_session_pty_cleanup2(void *session) |
mm_session_pty_cleanup2(Session *s) |
{ |
{ |
Session *s = session; |
|
Buffer m; |
Buffer m; |
|
|
if (s->ttyfd == -1) |
if (s->ttyfd == -1) |