ia64/xen-unstable

changeset 8545:3904e3c33611

Fix the build.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Jan 10 15:53:39 2006 +0100 (2006-01-10)
parents 1a0cc9fdcd48
children 50d46a775ad0
files tools/libxc/xc_linux_build.c
line diff
     1.1 --- a/tools/libxc/xc_linux_build.c	Tue Jan 10 14:44:36 2006 +0000
     1.2 +++ b/tools/libxc/xc_linux_build.c	Tue Jan 10 15:53:39 2006 +0100
     1.3 @@ -402,8 +402,11 @@ static int setup_guest(int xc_handle,
     1.4          ctxt->initrd.start    = 0;
     1.5          ctxt->initrd.size     = 0;
     1.6      }
     1.7 -    strncpy((char *)ctxt->cmdline, cmdline, IA64_COMMAND_LINE_SIZE);
     1.8 -    ctxt->cmdline[IA64_COMMAND_LINE_SIZE-1] = '\0';
     1.9 +    if ( cmdline != NULL )
    1.10 +    {
    1.11 +        strncpy((char *)ctxt->cmdline, cmdline, IA64_COMMAND_LINE_SIZE);
    1.12 +        ctxt->cmdline[IA64_COMMAND_LINE_SIZE-1] = '\0';
    1.13 +    }
    1.14      munmap(start_info, PAGE_SIZE);
    1.15  
    1.16      free(page_array);
    1.17 @@ -693,12 +696,11 @@ static int setup_guest(int xc_handle,
    1.18          start_info->mod_start    = vinitrd_start;
    1.19          start_info->mod_len      = initrd_len;
    1.20      }
    1.21 -    if (cmdline != NULL) {
    1.22 +    if ( cmdline != NULL )
    1.23      {
    1.24          strncpy((char *)start_info->cmd_line, cmdline, MAX_GUEST_CMDLINE);
    1.25          start_info->cmd_line[MAX_GUEST_CMDLINE-1] = '\0';
    1.26 -    } else
    1.27 -        start_info->cmd_line[0] = '\0';
    1.28 +    }
    1.29      munmap(start_info, PAGE_SIZE);
    1.30  
    1.31      /* shared_info page starts its life empty. */
    1.32 @@ -759,8 +761,7 @@ int xc_linux_build(int xc_handle,
    1.33          goto error_out;
    1.34      }
    1.35  
    1.36 -    if ( (image_name == NULL) ||
    1.37 -         ((image = xc_read_kernel_image(image_name, &image_size)) == NULL) )
    1.38 +    if ( (image = xc_read_kernel_image(image_name, &image_size)) == NULL )
    1.39          goto error_out;
    1.40  
    1.41      if ( (ramdisk_name != NULL) && (strlen(ramdisk_name) != 0) )