ia64/xen-unstable

changeset 988:d3717f48d4bb

bitkeeper revision 1.636.1.2 (3fcbbc74KQaXaXiWg8MaezyjiFxLhg)

Merge scramble.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into scramble.cl.cam.ac.uk:/local/scratch/kaf24/xeno
author kaf24@scramble.cl.cam.ac.uk
date Mon Dec 01 22:11:00 2003 +0000 (2003-12-01)
parents 9ceeacd05d1f 03601fb7a14d
children ac6bee72a4ae 2779d20e54e2
files tools/xc/lib/xc_misc.c
line diff
     1.1 --- a/tools/xc/lib/xc_misc.c	Mon Dec 01 17:33:22 2003 +0000
     1.2 +++ b/tools/xc/lib/xc_misc.c	Mon Dec 01 22:11:00 2003 +0000
     1.3 @@ -35,9 +35,14 @@ int xc_readconsolering(int xc_handle,
     1.4      op.u.readconsole.count = max_chars;
     1.5      op.u.readconsole.cmd = clear ? CONSOLE_RING_CLEAR : 0;
     1.6  
     1.7 -    if ( (ret = do_dom0_op(xc_handle, &op)) > 0 )
     1.8 +    if ( (ret = mlock(str, max_chars)) != 0 )
     1.9 +        return ret;
    1.10 +
    1.11 +    if ( (ret = do_dom0_op(xc_handle, &op)) >= 0 )
    1.12          str[ret] = '\0';
    1.13  
    1.14 +    (void)munlock(str, max_chars);
    1.15 +
    1.16      return ret;
    1.17  }    
    1.18