aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_core.c
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-03-02 21:36:03 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-03-02 21:36:03 +0100
commitc7466ca15d048b60bb8f071e90ddf082842e35df (patch)
tree75cc96160a69b828eb2f2ffd95dbb2e51abad8f5 /tools/libxc/xc_core.c
parenta78479d02820660e42757f5d47d3eac8001d753a (diff)
downloadxen-c7466ca15d048b60bb8f071e90ddf082842e35df.tar.gz
xen-c7466ca15d048b60bb8f071e90ddf082842e35df.tar.bz2
xen-c7466ca15d048b60bb8f071e90ddf082842e35df.zip
Fix libxc warnings with gcc-4.1 and glibc-2.3.90.
Signed-off-by: Charles Coffing <ccoffing@novell.com>
Diffstat (limited to 'tools/libxc/xc_core.c')
-rw-r--r--tools/libxc/xc_core.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/tools/libxc/xc_core.c b/tools/libxc/xc_core.c
index 43ac87d47f..0c763bbf8f 100644
--- a/tools/libxc/xc_core.c
+++ b/tools/libxc/xc_core.c
@@ -71,8 +71,12 @@ xc_domain_dumpcore(int xc_handle,
(sizeof(vcpu_guest_context_t) * nr_vcpus) +
(nr_pages * sizeof(unsigned long)));
- write(dump_fd, &header, sizeof(struct xc_core_header));
- write(dump_fd, &ctxt, sizeof(ctxt[0]) * nr_vcpus);
+ if (write(dump_fd, &header, sizeof(struct xc_core_header)) < 0 ||
+ write(dump_fd, &ctxt, sizeof(ctxt[0]) * nr_vcpus) < 0)
+ {
+ PERROR("write failed");
+ goto error_out;
+ }
if ((page_array = malloc(nr_pages * sizeof(unsigned long))) == NULL) {
printf("Could not allocate memory\n");
@@ -82,7 +86,11 @@ xc_domain_dumpcore(int xc_handle,
printf("Could not get the page frame list\n");
goto error_out;
}
- write(dump_fd, page_array, nr_pages * sizeof(unsigned long));
+ if (write(dump_fd, page_array, nr_pages * sizeof(unsigned long)) < 0)
+ {
+ PERROR("write failed");
+ goto error_out;
+ }
lseek(dump_fd, header.xch_pages_offset, SEEK_SET);
for (dump_mem = dump_mem_start, i = 0; i < nr_pages; i++) {
copy_from_domain_page(xc_handle, domid, page_array, i, dump_mem);