ia64/xen-unstable

changeset 19816:5f5112a7d2ff

xenconsoled: fix timestamp log

timestamp log is broken.
Also, xenconsoled might die with segfault.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jun 23 11:27:54 2009 +0100 (2009-06-23)
parents b6612dd06218
children b7f73a7f3078
files tools/console/daemon/io.c
line diff
     1.1 --- a/tools/console/daemon/io.c	Tue Jun 23 11:26:22 2009 +0100
     1.2 +++ b/tools/console/daemon/io.c	Tue Jun 23 11:27:54 2009 +0100
     1.3 @@ -127,7 +127,7 @@ static int write_with_timestamp(int fd, 
     1.4  	const char *last_byte = data + sz - 1;
     1.5  
     1.6  	while (data <= last_byte) {
     1.7 -		const char *nl = memchr(data, '\n', sz);
     1.8 +		const char *nl = memchr(data, '\n', last_byte + 1 - data);
     1.9  		int found_nl = (nl != NULL);
    1.10  		if (!found_nl)
    1.11  			nl = last_byte;