diff options
author | Ozkan Sezer <sezero@sourceware.org> | 2010-05-26 22:40:24 +0000 |
---|---|---|
committer | Ozkan Sezer <sezero@sourceware.org> | 2010-05-26 22:40:24 +0000 |
commit | 363a6e9f2c3fe1e25f8fa986347948897f189f39 (patch) | |
tree | 71182a438b05d879f96dc50f3dcd232c29f312cb /gdb/ser-tcp.c | |
parent | 2010-05-26 Catherine Moore <clm@codesourcery.com> (diff) | |
download | binutils-gdb-363a6e9f2c3fe1e25f8fa986347948897f189f39.tar.gz binutils-gdb-363a6e9f2c3fe1e25f8fa986347948897f189f39.tar.bz2 binutils-gdb-363a6e9f2c3fe1e25f8fa986347948897f189f39.zip |
2010-05-26 Ozkan Sezer <sezeroz@gmail.com>
gdb/
* ser-tcp.c (net_open): Check error return from socket() call by its
equality to -1 not by it being negative.
(net_close): Likewise.
gdb/gdbserver/
* gdbreplay.c (remote_open): Check error return from socket() call by
its equality to -1 not by it being negative.
* remote-utils.c (remote_open): Likewise.
sim/arm/
* communicate.c (MYread_char): Check error return from accept() call
by its equality to -1 not by it being negative.
(MYread_charwait): Likewise.
* main.c (main): Likewise for both socket() and accept() calls.
sim/common/
* dv-sockser.c (dv_sockser_init): Check error return from socket()
call by its equality to -1 not by it being negative.
(connected_p): Likewise for accept() call.
sim/cris/
* dv-rv.c (hw_rv_init_socket): Check error return from socket() call
by its equality to -1 not by it being negative.
(hw_rv_write): Likewise.
(hw_rv_handle_incoming): Likewise.
(hw_rv_poll_once): Likewise.
* rvdummy.c (setupsocket): Likewise.
(main): Likewise for accept() call as returned from setupsocket().
sim/m32c/
* main.c (setup_tcp_console): Check error return from socket() call
by its equality to -1 not by it being negative.
Diffstat (limited to 'gdb/ser-tcp.c')
-rw-r--r-- | gdb/ser-tcp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c index dd685e69348..cb862e7e55c 100644 --- a/gdb/ser-tcp.c +++ b/gdb/ser-tcp.c @@ -209,7 +209,7 @@ net_open (struct serial *scb, const char *name) else scb->fd = socket (PF_INET, SOCK_STREAM, 0); - if (scb->fd < 0) + if (scb->fd == -1) return -1; /* set socket nonblocking */ @@ -325,7 +325,7 @@ net_open (struct serial *scb, const char *name) void net_close (struct serial *scb) { - if (scb->fd < 0) + if (scb->fd == -1) return; close (scb->fd); |