aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2011-07-23 20:04:29 +0000
committerBlue Swirl <blauwirbel@gmail.com>2011-07-25 14:38:56 +0000
commitccd09ef0f5d4bccb53dc45cf8e7edab631a723f2 (patch)
tree9c53eaa2eb9826e06f0bd55469fe6ee10a28734a
parent68a340053c766490b3c7460e543aebcc4bee4efa (diff)
downloadslirp-ccd09ef0f5d4bccb53dc45cf8e7edab631a723f2.zip
slirp-ccd09ef0f5d4bccb53dc45cf8e7edab631a723f2.tar.gz
slirp-ccd09ef0f5d4bccb53dc45cf8e7edab631a723f2.tar.bz2
Wrap recv to avoid warningsv0.15.1v0.15.0-rc2v0.15.0-rc1v0.15.0
Avoid warnings like these by wrapping recv(): CC slirp/ip_icmp.o /src/qemu/slirp/ip_icmp.c: In function 'icmp_receive': /src/qemu/slirp/ip_icmp.c:418:5: error: passing argument 2 of 'recv' from incompatible pointer type [-Werror] /usr/local/lib/gcc/i686-mingw32msvc/4.6.0/../../../../i686-mingw32msvc/include/winsock2.h:547:32: note: expected 'char *' but argument is of type 'struct icmp *' Remove also casts used to avoid warnings. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
-rw-r--r--ip_icmp.c2
-rw-r--r--slirp.c2
-rw-r--r--socket.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/ip_icmp.c b/ip_icmp.c
index 2ccf19d..4b2c3be 100644
--- a/ip_icmp.c
+++ b/ip_icmp.c
@@ -425,7 +425,7 @@ void icmp_receive(struct socket *so)
icp = mtod(m, struct icmp *);
id = icp->icmp_id;
- len = recv(so->s, icp, m->m_len, 0);
+ len = qemu_recv(so->s, icp, m->m_len, 0);
icp->icmp_id = id;
m->m_data -= hlen;
diff --git a/slirp.c b/slirp.c
index 55f35a1..392dfa3 100644
--- a/slirp.c
+++ b/slirp.c
@@ -523,7 +523,7 @@ void slirp_select_poll(fd_set *readfds, fd_set *writefds, fd_set *xfds,
*/
#ifdef PROBE_CONN
if (so->so_state & SS_ISFCONNECTING) {
- ret = recv(so->s, (char *)&ret, 0, 0);
+ ret = qemu_recv(so->s, &ret, 0, 0);
if (ret < 0) {
/* XXX */
diff --git a/socket.c b/socket.c
index 00b6bc2..bc2d112 100644
--- a/socket.c
+++ b/socket.c
@@ -160,7 +160,7 @@ int soread(struct socket *so)
nn = readv(so->s, (struct iovec *)iov, n);
DEBUG_MISC((dfd, " ... read nn = %d bytes\n", nn));
#else
- nn = recv(so->s, iov[0].iov_base, iov[0].iov_len, 0);
+ nn = qemu_recv(so->s, iov[0].iov_base, iov[0].iov_len, 0);
#endif
if (nn <= 0) {
if (nn < 0 && (errno == EINTR || errno == EAGAIN))
@@ -187,7 +187,7 @@ int soread(struct socket *so)
*/
if (n == 2 && nn == iov[0].iov_len) {
int ret;
- ret = recv(so->s, iov[1].iov_base, iov[1].iov_len, 0);
+ ret = qemu_recv(so->s, iov[1].iov_base, iov[1].iov_len, 0);
if (ret > 0)
nn += ret;
}