WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Check a write() return value in xenbaked.
From: Xen patchbot -3.0-testing <patchbot-3.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 27 Apr 2006 12:30:21 +0000
Delivery-date: Thu, 27 Apr 2006 05:31:37 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>