ia64/xen-unstable

changeset 987:03601fb7a14d

bitkeeper revision 1.636.2.1 (3fcbbc64x-OxidVggJZzaY-7ZkmmVw)

xc_misc.c:
mlock console buffer.
author kaf24@scramble.cl.cam.ac.uk
date Mon Dec 01 22:10:44 2003 +0000 (2003-12-01)
parents c6cfb98dc402
children d3717f48d4bb
files tools/xc/lib/xc_misc.c
line diff
     1.1 --- a/tools/xc/lib/xc_misc.c	Tue Nov 25 15:36:17 2003 +0000
     1.2 +++ b/tools/xc/lib/xc_misc.c	Mon Dec 01 22:10:44 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