From: Philip Homburg Date: Fri, 30 Sep 2005 12:59:12 +0000 (+0000) Subject: Accept log output from TTY. X-Git-Tag: v3.1.2a~681 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.host.html?a=commitdiff_plain;h=72c015839355b8489850f67724e7c028f0ad9542;p=minix.git Accept log output from TTY. --- diff --git a/drivers/log/diag.c b/drivers/log/diag.c index 1ffa97100..3776db969 100644 --- a/drivers/log/diag.c +++ b/drivers/log/diag.c @@ -28,10 +28,28 @@ message *m; /* notification message */ int bytes; int i, r; - /* Try to get a fresh copy of the buffer with kernel messages. */ - if ((r=sys_getkmessages(&kmess)) != OK) { - report("LOG","couldn't get copy of kmessages", r); - return EDONTREPLY; + if (m->m_source == TTY_PROC_NR) + { + message mess; + + /* Ask TTY driver for log output */ + mess.GETKM_PTR= &kmess; + mess.m_type = GET_KMESS; + r= sendrec(TTY_PROC_NR, &mess); + if (r == OK) r= mess.m_type; + if (r != OK) + { + report("LOG","couldn't get copy of kmessages from TTY", r); + return EDONTREPLY; + } + } + else + { + /* Try to get a fresh copy of the buffer with kernel messages. */ + if ((r=sys_getkmessages(&kmess)) != OK) { + report("LOG","couldn't get copy of kmessages", r); + return EDONTREPLY; + } } /* Print only the new part. Determine how many new bytes there are with diff --git a/drivers/log/log.c b/drivers/log/log.c index f07d9b79e..4157e337e 100644 --- a/drivers/log/log.c +++ b/drivers/log/log.c @@ -419,6 +419,10 @@ message *m_ptr; r = EDONTREPLY; break; } + case NOTIFY_FROM(TTY_PROC_NR): + do_new_kmess(m_ptr); + r = EDONTREPLY; + break; default: r = EINVAL; break;