Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/fhandler_socket.cc')
-rw-r--r--winsup/cygwin/fhandler_socket.cc96
1 files changed, 48 insertions, 48 deletions
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index f0a819528..5b7e256ac 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -325,7 +325,7 @@ fhandler_socket::bind (const struct sockaddr *name, int namelen)
{
#define un_addr ((struct sockaddr_un *) name)
struct sockaddr_in sin;
- int len = sizeof sin;
+ int len = sizeof sin;
int fd;
if (strlen (un_addr->sun_path) >= UNIX_PATH_LEN)
@@ -513,45 +513,45 @@ fhandler_socket::accept (struct sockaddr *peer, int *len)
int wait_result;
wait_result = WSAWaitForMultipleEvents (2, ev, FALSE, WSA_INFINITE,
- FALSE);
- if (wait_result == WSA_WAIT_EVENT_0)
- WSAEnumNetworkEvents (get_socket (), ev[0], &sock_event);
+ FALSE);
+ if (wait_result == WSA_WAIT_EVENT_0)
+ WSAEnumNetworkEvents (get_socket (), ev[0], &sock_event);
- /* Unset events for listening socket and
- switch back to blocking mode */
- WSAEventSelect (get_socket (), ev[0], 0);
+ /* Unset events for listening socket and
+ switch back to blocking mode */
+ WSAEventSelect (get_socket (), ev[0], 0);
unsigned long nonblocking = 0;
- ioctlsocket (get_socket (), FIONBIO, &nonblocking);
-
- switch (wait_result)
- {
- case WSA_WAIT_EVENT_0:
- if (sock_event.lNetworkEvents & FD_ACCEPT)
- {
- if (sock_event.iErrorCode[FD_ACCEPT_BIT])
- {
- WSASetLastError (sock_event.iErrorCode[FD_ACCEPT_BIT]);
- set_winsock_errno ();
- res = -1;
- goto done;
- }
- }
- /* else; : Should never happen since FD_ACCEPT is the only event
- that has been selected */
- break;
- case WSA_WAIT_EVENT_0 + 1:
- debug_printf ("signal received during accept");
- set_errno (EINTR);
- res = -1;
- goto done;
- case WSA_WAIT_FAILED:
- default: /* Should never happen */
- WSASetLastError (WSAEFAULT);
- set_winsock_errno ();
- res = -1;
- goto done;
- }
- }
+ ioctlsocket (get_socket (), FIONBIO, &nonblocking);
+
+ switch (wait_result)
+ {
+ case WSA_WAIT_EVENT_0:
+ if (sock_event.lNetworkEvents & FD_ACCEPT)
+ {
+ if (sock_event.iErrorCode[FD_ACCEPT_BIT])
+ {
+ WSASetLastError (sock_event.iErrorCode[FD_ACCEPT_BIT]);
+ set_winsock_errno ();
+ res = -1;
+ goto done;
+ }
+ }
+ /* else; : Should never happen since FD_ACCEPT is the only event
+ that has been selected */
+ break;
+ case WSA_WAIT_EVENT_0 + 1:
+ debug_printf ("signal received during accept");
+ set_errno (EINTR);
+ res = -1;
+ goto done;
+ case WSA_WAIT_FAILED:
+ default: /* Should never happen */
+ WSASetLastError (WSAEFAULT);
+ set_winsock_errno ();
+ res = -1;
+ goto done;
+ }
+ }
}
res = ::accept (get_socket (), peer, len);
@@ -566,7 +566,7 @@ fhandler_socket::accept (struct sockaddr *peer, int *len)
{
if (!create_secret_event ())
secret_check_failed = TRUE;
- else if (in_progress)
+ else if (in_progress)
signal_secret_event ();
}
@@ -599,12 +599,12 @@ fhandler_socket::accept (struct sockaddr *peer, int *len)
set_winsock_errno ();
else
{
- fhandler_socket* res_fh = fdsock (res_fd, get_name (), res);
- if (get_addr_family () == AF_LOCAL)
- res_fh->set_sun_path (get_sun_path ());
- res_fh->set_addr_family (get_addr_family ());
- res_fh->set_socket_type (get_socket_type ());
- res = res_fd;
+ fhandler_socket* res_fh = fdsock (res_fd, get_name (), res);
+ if (get_addr_family () == AF_LOCAL)
+ res_fh->set_sun_path (get_sun_path ());
+ res_fh->set_addr_family (get_addr_family ());
+ res_fh->set_socket_type (get_socket_type ());
+ res = res_fd;
}
}
@@ -750,7 +750,7 @@ fhandler_socket::recvmsg (struct msghdr *msg, int flags, ssize_t tot)
{
tot = 0;
const struct iovec *iovptr = iov + iovcnt;
- do
+ do
{
iovptr -= 1;
tot += iovptr->iov_len;
@@ -903,7 +903,7 @@ fhandler_socket::sendto (const void *ptr, size_t len, int flags,
{
set_errno (EPIPE);
if (! (flags & MSG_NOSIGNAL))
- _raise (SIGPIPE);
+ _raise (SIGPIPE);
}
return res;
@@ -938,7 +938,7 @@ fhandler_socket::sendmsg (const struct msghdr *msg, int flags, ssize_t tot)
{
tot = 0;
const struct iovec *iovptr = iov + iovcnt;
- do
+ do
{
iovptr -= 1;
tot += iovptr->iov_len;