+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.
+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.
#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. */
#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. */
else
scb->fd = socket (PF_INET, SOCK_STREAM, 0);
- if (scb->fd < 0)
+ if (scb->fd == -1)
return -1;
/* set socket nonblocking */
void
net_close (struct serial *scb)
{
- if (scb->fd < 0)
+ if (scb->fd == -1)
return;
close (scb->fd);
+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.
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;
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;
/* Open a socket */
sockethandle = socket (hp->h_addrtype, SOCK_STREAM, 0);
- if (sockethandle < 0)
+ if (sockethandle == -1)
{
perror ("socket");
return 1;
fprintf (stderr, "Waiting for connection from debugger...");
debugsock = accept (sockethandle, &isa, &i);
- if (debugsock < 0)
+ if (debugsock == -1)
{
perror ("accept");
return 1;
+2010-05-26 Ozkan Sezer <sezeroz@gmail.com>
+
+ * 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.
+
2010-04-23 Mike Frysinger <vapier@gentoo.org>
* sim-fpu.c (sim_fpu_zero, sim_fpu_qnan): Add 0 initializers.
}
sockser_listen_fd = socket (PF_INET, SOCK_STREAM, 0);
- if (sockser_listen_fd < 0)
+ if (sockser_listen_fd == -1)
{
sim_io_eprintf (sd, "sockser init: unable to get socket: %s\n",
strerror (errno));
addrlen = sizeof (sockaddr);
sockser_fd = accept (sockser_listen_fd, &sockaddr, &addrlen);
- if (sockser_fd < 0)
+ if (sockser_fd == -1)
return 0;
/* Set non-blocking i/o. */
+2010-05-26 Ozkan Sezer <sezeroz@gmail.com>
+
+ * 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().
+
2010-03-30 Mike Frysinger <vapier@gentoo.org>
* devices.c (device_error): Add const to message.
/* If we don't have a valid fd here, it's because we got an error
initially, and we suppressed that error. */
- if (rv->fd < 0)
+ if (rv->fd == -1)
hw_abort (me, "couldn't open a connection to %s:%d because: %s",
rv->host, rv->port, strerror (rv->saved_errno));
{
hw_rv_read (me, cbuf, 3);
- if (rv->fd < 0)
+ if (rv->fd == -1)
return;
len = cbuf[0] + cbuf[1] * 256 - 3;
int ret;
struct timeval tv;
- if (rv->fd < 0)
+ if (rv->fd == -1)
/* Connection has died or was never initiated. */
return;
server.sin_port = htons (rv->port);
sock = socket (AF_INET, SOCK_STREAM, 0);
- if (sock < 0)
+ if (sock == -1)
hw_abort (me, "can't get a socket for %s:%d connection",
rv->host, rv->port);
memset (&sa_in, 0, sizeof (sa_in));
s = socket (AF_INET, SOCK_STREAM, 0);
- if (s < 0)
+ if (s == -1)
return -1;
if (setsockopt (s, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof reuse) != 0)
}
fd = setupsocket ();
- if (fd < 0)
+ if (fd == -1)
{
fprintf (stderr, "%s: problem setting up the connection: %s\n",
progname, strerror (errno));
+2010-05-26 Ozkan Sezer <sezeroz@gmail.com>
+
+ * main.c (setup_tcp_console): Check error return from socket() call
+ by its equality to -1 not by it being negative.
+
2010-04-14 Mike Frysinger <vapier@gentoo.org>
* gdb-if.c (sim_write): Add const to buf arg.
address.sin_port = htons (port);
isocket = socket (AF_INET, SOCK_STREAM, 0);
- if (isocket < 0)
+ if (isocket == -1)
{
perror ("socket");
exit (1);