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 /sim/arm | |
parent | 9db8dccb1711d06bd180437fcd8c78c5f0981193 (diff) | |
download | gdb-363a6e9f2c3fe1e25f8fa986347948897f189f39.zip gdb-363a6e9f2c3fe1e25f8fa986347948897f189f39.tar.gz gdb-363a6e9f2c3fe1e25f8fa986347948897f189f39.tar.bz2 |
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 'sim/arm')
-rw-r--r-- | sim/arm/ChangeLog | 7 | ||||
-rw-r--r-- | sim/arm/communicate.c | 4 | ||||
-rw-r--r-- | sim/arm/main.c | 4 |
3 files changed, 11 insertions, 4 deletions
diff --git a/sim/arm/ChangeLog b/sim/arm/ChangeLog index 192f07e..1e07144 100644 --- a/sim/arm/ChangeLog +++ b/sim/arm/ChangeLog @@ -1,3 +1,10 @@ +2010-05-26 Ozkan Sezer <sezeroz@gmail.com> + + * 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. + 2010-04-14 Mike Frysinger <vapier@gentoo.org> * wrapper.c (sim_write): Add const to buffer arg. diff --git a/sim/arm/communicate.c b/sim/arm/communicate.c index 2fabbaa..fac2b60 100644 --- a/sim/arm/communicate.c +++ b/sim/arm/communicate.c @@ -83,7 +83,7 @@ retry: return -1; fprintf (stderr, "Waiting for connection from debugger..."); debugsock = accept (sockethandle, &isa, &i); - if (debugsock < 0) + if (debugsock == -1) { /* Now we are in serious trouble... */ perror ("accept"); return -1; @@ -138,7 +138,7 @@ retry: return -1; fprintf (stderr, "Waiting for connection from debugger..."); debugsock = accept (sockethandle, &isa, &i); - if (debugsock < 0) + if (debugsock == -1) { /* Now we are in serious trouble... */ perror ("accept"); return -1; diff --git a/sim/arm/main.c b/sim/arm/main.c index 1841ae4..9bc20fe 100644 --- a/sim/arm/main.c +++ b/sim/arm/main.c @@ -117,7 +117,7 @@ main (int argc, char *argv[]) /* Open a socket */ sockethandle = socket (hp->h_addrtype, SOCK_STREAM, 0); - if (sockethandle < 0) + if (sockethandle == -1) { perror ("socket"); return 1; @@ -147,7 +147,7 @@ main (int argc, char *argv[]) fprintf (stderr, "Waiting for connection from debugger..."); debugsock = accept (sockethandle, &isa, &i); - if (debugsock < 0) + if (debugsock == -1) { perror ("accept"); return 1; |