[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 1d1a994059948396480130af9e2175c148295590
# Parent  490384f7d531e957c7a3ebf3999a124072b0609e
Check a write() return value in xenbaked.

From: Jeremy Katz

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

diff -r 490384f7d531 -r 1d1a99405994 tools/xenmon/xenbaked.c
--- a/tools/xenmon/xenbaked.c   Thu Apr 27 09:44:28 2006 +0100
+++ b/tools/xenmon/xenbaked.c   Thu Apr 27 09:47:42 2006 +0100
@@ -549,7 +549,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®.