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] [xen-4.0-testing] tools: gdbsx: Check return of write()

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.0-testing] tools: gdbsx: Check return of write()
From: "Xen patchbot-4.0-testing" <patchbot-4.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 09 Nov 2010 12:10:15 -0800
Delivery-date: Tue, 09 Nov 2010 12:11:46 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 Keir Fraser <keir@xxxxxxx>
# Date 1289230777 0
# Node ID 31602ac2b5fa80af1669cbab5863baf8a50acd8d
# Parent  5c8057e8f9af3ff4ba01c2151f3c2bb2d461c363
tools: gdbsx: Check return of write()

Not checking leads to warn_unused_result checks triggering in some
libraries and compilers.  Combined with -Werror this breaks the build.

Signed-off-by: Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
xen-unstable changeset:   22349:3f98881703aa
xen-unstable date:        Wed Nov 03 11:58:25 2010 +0000
---
 tools/debugger/gdbsx/gx/gx_comm.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff -r 5c8057e8f9af -r 31602ac2b5fa tools/debugger/gdbsx/gx/gx_comm.c
--- a/tools/debugger/gdbsx/gx/gx_comm.c Mon Nov 08 15:36:58 2010 +0000
+++ b/tools/debugger/gdbsx/gx/gx_comm.c Mon Nov 08 15:39:37 2010 +0000
@@ -227,13 +227,19 @@ gx_getpkt (char *buf)
         
         gxprt("Bad checksum, sentsum=0x%x, csum=0x%x, buf=%s\n",
               (c1 << 4) + c2, csum, buf);
-        write(remote_fd, "-", 1);
+        if (write(remote_fd, "-", 1) != 1) {
+            perror("write");
+            return -1;
+        }
     }
     if (gx_remote_dbg) {
         gxprt("getpkt (\"%s\");  [sending ack] \n", buf);
     }
         
-    write(remote_fd, "+", 1);
+    if (write(remote_fd, "+", 1) != 1) {
+        perror("write");
+        return -1;
+    }
         
     if (gx_remote_dbg) {
         gxprt("[sent ack]\n");

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-4.0-testing] tools: gdbsx: Check return of write(), Xen patchbot-4.0-testing <=