Accept log output from TTY.
This commit is contained in:
		
							parent
							
								
									e0dbf0cd67
								
							
						
					
					
						commit
						72c0158393
					
				@ -28,11 +28,29 @@ message *m;					/* notification message */
 | 
			
		||||
  int bytes;
 | 
			
		||||
  int i, r;
 | 
			
		||||
 | 
			
		||||
  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 
 | 
			
		||||
   * help of the current and previous 'next' index. Note that the kernel
 | 
			
		||||
 | 
			
		||||
@ -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;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user