]> Zhao Yanbai Git Server - minix.git/commitdiff
Accept log output from TTY.
authorPhilip Homburg <philip@cs.vu.nl>
Fri, 30 Sep 2005 12:59:12 +0000 (12:59 +0000)
committerPhilip Homburg <philip@cs.vu.nl>
Fri, 30 Sep 2005 12:59:12 +0000 (12:59 +0000)
drivers/log/diag.c
drivers/log/log.c

index 1ffa9710069d2635842a26b56ee12f35d5346f9d..3776db9696d0dae1ba4a97309c4f3c278a1cd5a5 100644 (file)
@@ -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 
index f07d9b79e0f9b4ed34c7b8e982b95a2d7d171214..4157e337ecfc0ef8e3cb10f2f489f42c5b92e163 100644 (file)
@@ -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;