]> Zhao Yanbai Git Server - minix.git/commitdiff
Use safecopy version to get log messages from TTY.
authorPhilip Homburg <philip@cs.vu.nl>
Mon, 10 Jul 2006 12:42:31 +0000 (12:42 +0000)
committerPhilip Homburg <philip@cs.vu.nl>
Mon, 10 Jul 2006 12:42:31 +0000 (12:42 +0000)
drivers/log/Makefile
drivers/log/diag.c

index 94b82c5ae9812766486a15c8f32b991403f5dfbd..7606e63b3b180d49d25061f1f84237eefe85428a 100644 (file)
@@ -23,7 +23,7 @@ LIBDRIVER = $d/libdriver/driver.o
 all build:     $(DRIVER)
 $(DRIVER):     $(OBJ) $(LIBDRIVER)
        $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBDRIVER) $(LIBS)
-       install -S 4kb $(DRIVER)
+       install -S 8kb $(DRIVER)
 
 $(LIBDRIVER): 
        cd $d/libdriver && $(MAKE) 
index 7a1cce9142a5d80d9fe4f3a927b0b88bac7033e2..3e72a59f9222024afcaafe9ea3f7ae79576e9227 100644 (file)
@@ -32,12 +32,23 @@ message *m;                                 /* notification message */
 
   if (m->m_source == TTY_PROC_NR)
   {
+       cp_grant_id_t gid;
        message mess;
 
+       gid= cpf_grant_direct(TTY_PROC_NR, (vir_bytes)&kmess, sizeof(kmess),
+               CPF_WRITE);
+       if (gid == -1)
+       {
+               report("LOG","cpf_grant_direct failed for TTY", errno);
+               return EDONTREPLY;
+       }
+
        /* Ask TTY driver for log output */
-       mess.GETKM_PTR= (char *) &kmess;
-       mess.m_type = GET_KMESS;
+       mess.GETKM_GRANT= gid;
+       mess.m_type = GET_KMESS_S;
        r= sendrec(TTY_PROC_NR, &mess);
+       cpf_revoke(gid);
+
        if (r == OK) r= mess.m_type;
        if (r != OK)
        {