ia64/xen-unstable

changeset 6562:7115d6c6c792

Use MIN instead of MAX to avoid reading more than fits into the buffer.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Wed Aug 31 08:43:31 2005 +0000 (2005-08-31)
parents 38312fe7ec38
children f41f8d753b7a
files tools/console/daemon/io.c
line diff
     1.1 --- a/tools/console/daemon/io.c	Wed Aug 31 08:27:34 2005 +0000
     1.2 +++ b/tools/console/daemon/io.c	Wed Aug 31 08:43:31 2005 +0000
     1.3 @@ -371,7 +371,7 @@ static void handle_tty_read(struct domai
     1.4  		(struct ring_head *)(dom->page + PAGE_SIZE/2);
     1.5  	int i;
     1.6  
     1.7 -	len = read(dom->tty_fd, msg, MAX(XENCONS_SPACE(inring), sizeof(msg)));
     1.8 +	len = read(dom->tty_fd, msg, MIN(XENCONS_SPACE(inring), sizeof(msg)));
     1.9  	if (len < 1) {
    1.10  		close(dom->tty_fd);
    1.11  		dom->tty_fd = -1;