[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Check a write() return value in xenbaked.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID d66dfd584d2f6573103172e4544309e87244631d
# Parent  d265c79031afe9689271c03c56ed20069472f7ff
Check a write() return value in xenbaked.

From: Jeremy Katz

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r d265c79031af -r d66dfd584d2f tools/xenmon/xenbaked.c
--- a/tools/xenmon/xenbaked.c   Thu Apr 27 09:43:49 2006 +0100
+++ b/tools/xenmon/xenbaked.c   Thu Apr 27 09:47:05 2006 +0100
@@ -677,7 +677,10 @@ void alloc_qos_data(int ncpu)
     for (n=0; n<ncpu; n++) {
 
       for (i=0; i<sizeof(_new_qos_data); i=i+pgsize)
-        write(qos_fd, dummy, pgsize);
+          if ((write(qos_fd, dummy, pgsize)) != pgsize) {
+              PERROR(SHARED_MEM_FILE);
+              exit(2);
+          }
 
       new_qos = (_new_qos_data *) mmap(0, sizeof(_new_qos_data), 
PROT_READ|PROT_WRITE, 
                                       MAP_SHARED, qos_fd, off);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.