Use nonblocking sends to reply, fixed reply message for DIAGNOSTICS(_S)

This commit is contained in:
Philip Homburg 2008-02-22 16:03:00 +00:00
parent e3d4c74393
commit 00ef93d6a2
2 changed files with 14 additions and 7 deletions

View File

@ -1132,7 +1132,8 @@ int safe;
cons_putk(c); cons_putk(c);
} }
cons_putk(0); /* always terminate, even with EFAULT */ cons_putk(0); /* always terminate, even with EFAULT */
m_ptr->m_type = result; m_ptr->m_type = DIAG_REPL;
m_ptr->REP_STATUS = result;
send(m_ptr->m_source, m_ptr); send(m_ptr->m_source, m_ptr);
} }

View File

@ -212,7 +212,11 @@ PUBLIC void main(void)
continue; continue;
} }
case DIAGNOSTICS: /* a server wants to print some */ case DIAGNOSTICS: /* a server wants to print some */
printf("WARNING: old DIAGNOSTICS from %d\n", tty_mess.m_source); if (tty_mess.m_source != LOG_PROC_NR)
{
printf("WARNING: old DIAGNOSTICS from %d\n",
tty_mess.m_source);
}
do_diagnostics(&tty_mess, 0); do_diagnostics(&tty_mess, 0);
continue; continue;
case DIAGNOSTICS_S: case DIAGNOSTICS_S:
@ -377,8 +381,10 @@ message *m_ptr;
} }
/* Almost done. Send back the reply message to the caller. */ /* Almost done. Send back the reply message to the caller. */
if ((status = send(m_ptr->m_source, m_ptr)) != OK) { status = sendnb(m_ptr->m_source, m_ptr);
panic("TTY","send in do_status failed, status\n", status); if (status != OK) {
printf("tty`do_status: send to %d failed: %d\n",
m_ptr->m_source, status);
} }
} }
@ -1473,9 +1479,9 @@ int status; /* reply code */
panic("TTY","tty_reply sending TTY_REVIVE", NO_NUM); panic("TTY","tty_reply sending TTY_REVIVE", NO_NUM);
} }
if ((status = send(replyee, &tty_mess)) != OK) { status = sendnb(replyee, &tty_mess);
printf("tty: tty_reply to %d failed: %d\n", replyee, status); if (status != OK)
} printf("tty`tty_reply: send to %d failed: %d\n", replyee, status);
} }
/*===========================================================================* /*===========================================================================*