* fhandler_socket.cc (fhandler_socket::sendto): Always initialize

ret to 0.
	(fhandler_socket::sendmsg): Ditto.
This commit is contained in:
Corinna Vinschen 2005-06-10 21:47:24 +00:00
parent 6700d99e7e
commit b4177338e1
2 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2005-06-10 Corinna Vinschen <corinna@vinschen.de>
* fhandler_socket.cc (fhandler_socket::sendto): Always initialize
ret to 0.
(fhandler_socket::sendmsg): Ditto.
2005-06-10 Corinna Vinschen <corinna@vinschen.de>
* cygwin.din (imaxabs): Export.

View File

@ -1201,7 +1201,7 @@ fhandler_socket::sendto (const void *ptr, size_t len, int flags,
return SOCKET_ERROR;
int res = SOCKET_ERROR;
DWORD ret;
DWORD ret = 0;
if (!winsock2_active)
ret = res = ::sendto (get_socket (), (const char *) ptr, len,
@ -1212,7 +1212,7 @@ fhandler_socket::sendto (const void *ptr, size_t len, int flags,
WSABUF wsabuf = { len, (char *) ptr };
if (is_nonblocking () || closed () || async_io ())
res = WSASendTo (get_socket (), &wsabuf, 1, (ret = 0, &ret),
res = WSASendTo (get_socket (), &wsabuf, 1, &ret,
flags & MSG_WINMASK,
(to ? (const struct sockaddr *) &sin : NULL), tolen,
NULL, NULL);
@ -1340,10 +1340,10 @@ fhandler_socket::sendmsg (const struct msghdr *msg, int flags, ssize_t tot)
while (wsaptr != wsabuf);
}
DWORD ret;
DWORD ret = 0;
if (is_nonblocking () || closed () || async_io ())
res = WSASendTo (get_socket (), wsabuf, iovcnt, (ret = 0, &ret),
res = WSASendTo (get_socket (), wsabuf, iovcnt, &ret,
flags, (struct sockaddr *) msg->msg_name,
msg->msg_namelen, NULL, NULL);
else