137
WriteOldMessage(struct msg *m)
139
sleep(1); /* give the server some time to reopen the pipe */
140
if (m->type == MSG_ATTACH && (m->m.attach.detachfirst == MSG_ATTACH ||
141
m->m.attach.detachfirst == MSG_DETACH ||
142
m->m.attach.detachfirst == MSG_POW_DETACH))
144
struct old_msg old_m;
146
int r, l = sizeof(old_m);
148
s = MakeClientSocket(0);
151
old_m.protocol_revision = (('m'<<24) | ('s'<<16) | ('g'<<8) | 0);
152
old_m.type = m->type;
153
memcpy(old_m.m_tty, m->m_tty, sizeof(old_m.m_tty));
154
memcpy(old_m.m.attach.auser, m->m.attach.auser, sizeof(old_m.m.attach.auser));
155
old_m.m.attach.apid = m->m.attach.apid;
156
old_m.m.attach.adaptflag = m->m.attach.adaptflag;
157
old_m.m.attach.lines = m->m.attach.lines;
158
old_m.m.attach.columns = m->m.attach.columns;
159
memcpy(old_m.m.attach.preselect, m->m.attach.preselect, sizeof(old_m.m.attach.preselect));
160
old_m.m.attach.esc = m->m.attach.esc;
161
old_m.m.attach.meta_esc = m->m.attach.meta_esc;
162
memcpy(old_m.m.attach.envterm, m->m.attach.envterm, sizeof(old_m.m.attach.envterm));
163
old_m.m.attach.encoding = m->m.attach.encoding;
166
r = write(s, (char *)&old_m + (sizeof(struct old_msg) - l), l);
167
if (r == -1 && errno == EINTR)
169
if (r == -1 || r == 0)
439
397
if (WriteMessage(lasts, &m))
440
398
Panic(errno, "WriteMessage");
443
400
debug1("Attach(%d): sent\n", m.type);
445
402
if (multi && (how == MSG_ATTACH || how == MSG_CONT))