aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorOzkan Sezer <sezero@sourceware.org>2010-05-26 22:40:24 +0000
committerOzkan Sezer <sezero@sourceware.org>2010-05-26 22:40:24 +0000
commit363a6e9f2c3fe1e25f8fa986347948897f189f39 (patch)
tree71182a438b05d879f96dc50f3dcd232c29f312cb /gdb
parent9db8dccb1711d06bd180437fcd8c78c5f0981193 (diff)
downloadgdb-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 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/gdbserver/ChangeLog6
-rw-r--r--gdb/gdbserver/gdbreplay.c2
-rw-r--r--gdb/gdbserver/remote-utils.c2
-rw-r--r--gdb/ser-tcp.c4
5 files changed, 16 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a878f01..50a41c0 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2010-05-26 Ozkan Sezer <sezeroz@gmail.com>
+
+ * ser-tcp.c (net_open): Check error return from socket() call by its
+ equality to -1 not by it being negative.
+ (net_close): Likewise.
+
2010-05-26 Pedro Alves <pedro@codesourcery.com>
* NEWS: Mention the `qRelocInsn' feature.
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index d8a3c50..e9c960e 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,9 @@
+2010-05-26 Ozkan Sezer <sezeroz@gmail.com>
+
+ * 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.
+
2010-05-23 Pedro Alves <pedro@codesourcery.com>
* config.h: Regenerate.
diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c
index a128413..3ae8051 100644
--- a/gdb/gdbserver/gdbreplay.c
+++ b/gdb/gdbserver/gdbreplay.c
@@ -210,7 +210,7 @@ remote_open (char *name)
#endif
tmp_desc = socket (PF_INET, SOCK_STREAM, 0);
- if (tmp_desc < 0)
+ if (tmp_desc == -1)
perror_with_name ("Can't open socket");
/* Allow rapid reuse of this port. */
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index 6410659..164ce6a 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -305,7 +305,7 @@ remote_open (char *name)
#endif
listen_desc = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP);
- if (listen_desc < 0)
+ if (listen_desc == -1)
perror_with_name ("Can't open socket");
/* Allow rapid reuse of this port. */
diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c
index dd685e6..cb862e7 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);