diff options
author | Ian Jackson <Ian.Jackson@eu.citrix.com> | 2010-11-03 11:58:25 +0000 |
---|---|---|
committer | Ian Jackson <Ian.Jackson@eu.citrix.com> | 2010-11-03 11:58:25 +0000 |
commit | 02bac862c003b2da5bb5c396e3ca19a7fb6990ea (patch) | |
tree | 5084c800d4797b9ea40d36dcc33ce9285ee68fa8 /tools | |
parent | 9f8c12b1cee360ce1dc0d7d8dea45fb446a4167b (diff) | |
download | xen-02bac862c003b2da5bb5c396e3ca19a7fb6990ea.tar.gz xen-02bac862c003b2da5bb5c396e3ca19a7fb6990ea.tar.bz2 xen-02bac862c003b2da5bb5c396e3ca19a7fb6990ea.zip |
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@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/debugger/gdbsx/gx/gx_comm.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/debugger/gdbsx/gx/gx_comm.c b/tools/debugger/gdbsx/gx/gx_comm.c index 156a9f5f55..ed4a7bef0e 100644 --- a/tools/debugger/gdbsx/gx/gx_comm.c +++ b/tools/debugger/gdbsx/gx/gx_comm.c @@ -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"); |