From: Philip Homburg Date: Mon, 10 Jul 2006 12:42:31 +0000 (+0000) Subject: Use safecopy version to get log messages from TTY. X-Git-Tag: v3.1.3~260 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/doxygen.png?a=commitdiff_plain;h=9392742cc4a7569c4b38ee722573ff5ce756ce17;p=minix.git Use safecopy version to get log messages from TTY. --- diff --git a/drivers/log/Makefile b/drivers/log/Makefile index 94b82c5ae..7606e63b3 100644 --- a/drivers/log/Makefile +++ b/drivers/log/Makefile @@ -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) diff --git a/drivers/log/diag.c b/drivers/log/diag.c index 7a1cce914..3e72a59f9 100644 --- a/drivers/log/diag.c +++ b/drivers/log/diag.c @@ -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) {