printf() by kernel and servers now send messages to an array of processes,

OUTPUT_PROCS_ARRAY in <minix/config.h>, in that order, terminated by NONE.
log no longer forwards messages to tty itself. This leads to less funny
loops and more robust debug-message handling. Also the list of
processes receiving messages can easily be changed around or disabled by
editing the array (e.g. disable it by changing the array to { NONE }.).
This commit is contained in:
Ben Gras
2005-10-18 10:34:54 +00:00
parent d87bfc438b
commit ea75918df1
5 changed files with 25 additions and 18 deletions
+2 -2
View File
@@ -29,8 +29,8 @@ $(LIBDRIVER):
cd $d/libdriver && $(MAKE)
# install with other drivers
install: /usr/sbin/$(DRIVER)
/usr/sbin/$(DRIVER): $(DRIVER)
install: /sbin/$(DRIVER)
/sbin/$(DRIVER): $(DRIVER)
install -o root -cs $? $@
# clean up local files
+2 -7
View File
@@ -91,7 +91,6 @@ PUBLIC int do_diagnostics(message *m)
* user. It also saves a copy in a local buffer so that messages can be
* reviewed at a later time.
*/
int result;
int proc_nr;
vir_bytes src;
int count;
@@ -99,13 +98,9 @@ PUBLIC int do_diagnostics(message *m)
int i = 0;
static char diagbuf[10240];
/* Forward the message to the TTY driver. Inform the TTY driver about the
* original sender, so that it knows where the buffer to be printed is.
* The message type, DIAGNOSTICS, remains the same.
*/
/* Change SELF to actual process number. */
if ((proc_nr = m->DIAG_PROC_NR) == SELF)
m->DIAG_PROC_NR = proc_nr = m->m_source;
result = _sendrec(TTY_PROC_NR, m);
/* Now also make a copy for the private buffer at the LOG server, so
* that the messages can be reviewed at a later time.
@@ -121,5 +116,5 @@ PUBLIC int do_diagnostics(message *m)
}
log_append(diagbuf, i);
return result;
return OK;
}