mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-17 21:26:13 -07:00
Wrap recv to avoid warnings
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>
This commit is contained in:
parent
aad04cd024
commit
00aa0040e8
13 changed files with 21 additions and 15 deletions
|
|
@ -166,7 +166,7 @@ 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))
|
||||
|
|
@ -191,7 +191,7 @@ 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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue