ia64/xen-unstable

changeset 9112:316fafc6d743

Fix libxc warnings with gcc-4.1 and glibc-2.3.90.

Signed-off-by: Charles Coffing <ccoffing@novell.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Mar 02 21:36:03 2006 +0100 (2006-03-02)
parents dfa7ba9c1296
children af04fef70bad
files tools/libxc/xc_core.c
line diff
     1.1 --- a/tools/libxc/xc_core.c	Thu Mar 02 21:35:17 2006 +0100
     1.2 +++ b/tools/libxc/xc_core.c	Thu Mar 02 21:36:03 2006 +0100
     1.3 @@ -71,8 +71,12 @@ xc_domain_dumpcore(int xc_handle,
     1.4                                           (sizeof(vcpu_guest_context_t) * nr_vcpus) +
     1.5                                           (nr_pages * sizeof(unsigned long)));
     1.6  
     1.7 -    write(dump_fd, &header, sizeof(struct xc_core_header));
     1.8 -    write(dump_fd, &ctxt, sizeof(ctxt[0]) * nr_vcpus);
     1.9 +    if (write(dump_fd, &header, sizeof(struct xc_core_header)) < 0 ||
    1.10 +        write(dump_fd, &ctxt, sizeof(ctxt[0]) * nr_vcpus) < 0)
    1.11 +    {
    1.12 +        PERROR("write failed");
    1.13 +        goto error_out;
    1.14 +    }
    1.15  
    1.16      if ((page_array = malloc(nr_pages * sizeof(unsigned long))) == NULL) {
    1.17          printf("Could not allocate memory\n");
    1.18 @@ -82,7 +86,11 @@ xc_domain_dumpcore(int xc_handle,
    1.19          printf("Could not get the page frame list\n");
    1.20          goto error_out;
    1.21      }
    1.22 -    write(dump_fd, page_array, nr_pages * sizeof(unsigned long));
    1.23 +    if (write(dump_fd, page_array, nr_pages * sizeof(unsigned long)) < 0)
    1.24 +    {
    1.25 +        PERROR("write failed");
    1.26 +        goto error_out;
    1.27 +    }
    1.28      lseek(dump_fd, header.xch_pages_offset, SEEK_SET);
    1.29      for (dump_mem = dump_mem_start, i = 0; i < nr_pages; i++) {
    1.30          copy_from_domain_page(xc_handle, domid, page_array, i, dump_mem);