Use safecopy version to get log messages from TTY.
This commit is contained in:
parent
fd62815e73
commit
9392742cc4
2 changed files with 14 additions and 3 deletions
|
@ -23,7 +23,7 @@ LIBDRIVER = $d/libdriver/driver.o
|
||||||
all build: $(DRIVER)
|
all build: $(DRIVER)
|
||||||
$(DRIVER): $(OBJ) $(LIBDRIVER)
|
$(DRIVER): $(OBJ) $(LIBDRIVER)
|
||||||
$(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBDRIVER) $(LIBS)
|
$(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBDRIVER) $(LIBS)
|
||||||
install -S 4kb $(DRIVER)
|
install -S 8kb $(DRIVER)
|
||||||
|
|
||||||
$(LIBDRIVER):
|
$(LIBDRIVER):
|
||||||
cd $d/libdriver && $(MAKE)
|
cd $d/libdriver && $(MAKE)
|
||||||
|
|
|
@ -32,12 +32,23 @@ message *m; /* notification message */
|
||||||
|
|
||||||
if (m->m_source == TTY_PROC_NR)
|
if (m->m_source == TTY_PROC_NR)
|
||||||
{
|
{
|
||||||
|
cp_grant_id_t gid;
|
||||||
message mess;
|
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 */
|
/* Ask TTY driver for log output */
|
||||||
mess.GETKM_PTR= (char *) &kmess;
|
mess.GETKM_GRANT= gid;
|
||||||
mess.m_type = GET_KMESS;
|
mess.m_type = GET_KMESS_S;
|
||||||
r= sendrec(TTY_PROC_NR, &mess);
|
r= sendrec(TTY_PROC_NR, &mess);
|
||||||
|
cpf_revoke(gid);
|
||||||
|
|
||||||
if (r == OK) r= mess.m_type;
|
if (r == OK) r= mess.m_type;
|
||||||
if (r != OK)
|
if (r != OK)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue