[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] tools: gdbsx: Check return of write()
# HG changeset patch # User Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx> # Date 1288785505 0 # Node ID 3f98881703aa4c2c0a59a7be67ebca275f9cbe21 # Parent 2dfba250c50bafac4e333d84450324daedf5ae2c 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> --- tools/debugger/gdbsx/gx/gx_comm.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff -r 2dfba250c50b -r 3f98881703aa tools/debugger/gdbsx/gx/gx_comm.c --- a/tools/debugger/gdbsx/gx/gx_comm.c Wed Nov 03 08:18:51 2010 +0000 +++ b/tools/debugger/gdbsx/gx/gx_comm.c Wed Nov 03 11:58:25 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
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |