Cygwin: fix whitespaces in socket code

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2018-02-21 21:43:44 +01:00
parent 859d215b7e
commit 8906a4d335
3 changed files with 7 additions and 7 deletions

View File

@ -203,7 +203,7 @@ fhandler_socket_inet::connect (const struct sockaddr *name, int namelen)
if (res) if (res)
{ {
DWORD err = WSAGetLastError (); DWORD err = WSAGetLastError ();
/* Some applications use the ugly technique to check if a non-blocking /* Some applications use the ugly technique to check if a non-blocking
connect succeeded by calling connect again, until it returns EISCONN. connect succeeded by calling connect again, until it returns EISCONN.
This circumvents the event handling and connect_state is never set. This circumvents the event handling and connect_state is never set.
@ -215,13 +215,13 @@ fhandler_socket_inet::connect (const struct sockaddr *name, int namelen)
else if (is_nonblocking () && err == WSAEWOULDBLOCK) else if (is_nonblocking () && err == WSAEWOULDBLOCK)
WSASetLastError (WSAEINPROGRESS); WSASetLastError (WSAEINPROGRESS);
/* Winsock returns WSAEINVAL if the socket is already a listener. /* Winsock returns WSAEINVAL if the socket is already a listener.
Convert to POSIX/Linux compliant EISCONN. */ Convert to POSIX/Linux compliant EISCONN. */
else if (err == WSAEINVAL && connect_state () == listener) else if (err == WSAEINVAL && connect_state () == listener)
WSASetLastError (WSAEISCONN); WSASetLastError (WSAEISCONN);
/* Any other error except WSAEALREADY during connect_pending means the /* Any other error except WSAEALREADY during connect_pending means the
connect failed. */ connect failed. */
else if (connect_state () == connect_pending && err != WSAEALREADY) else if (connect_state () == connect_pending && err != WSAEALREADY)
connect_state (connect_failed); connect_state (connect_failed);
set_winsock_errno (); set_winsock_errno ();
} }
@ -631,7 +631,7 @@ fhandler_socket_inet::read (void *in_ptr, size_t& len)
WSABUF wsabuf = { len, ptr }; WSABUF wsabuf = { len, ptr };
WSAMSG wsamsg = { NULL, 0, &wsabuf, 1, { 0, NULL }, 0 }; WSAMSG wsamsg = { NULL, 0, &wsabuf, 1, { 0, NULL }, 0 };
#endif #endif
len = recv_internal (&wsamsg, false); len = recv_internal (&wsamsg, false);
} }
@ -1132,7 +1132,7 @@ fhandler_socket_inet::getsockopt (int level, int optname, const void *optval,
break; break;
} }
break; break;
case IPPROTO_TCP: case IPPROTO_TCP:
switch (optname) switch (optname)
{ {
case TCP_NODELAY: case TCP_NODELAY:

View File

@ -1310,7 +1310,7 @@ fhandler_socket_local::read (void *in_ptr, size_t& len)
WSABUF wsabuf = { len, ptr }; WSABUF wsabuf = { len, ptr };
WSAMSG wsamsg = { NULL, 0, &wsabuf, 1, { 0, NULL }, 0 }; WSAMSG wsamsg = { NULL, 0, &wsabuf, 1, { 0, NULL }, 0 };
#endif #endif
len = recv_internal (&wsamsg, false); len = recv_internal (&wsamsg, false);
} }

View File

@ -251,7 +251,7 @@ connect_syslogd ()
syslogd_inited = inited_dgram; syslogd_inited = inited_dgram;
} }
else else
close (fd); close (fd);
} }
syslogd_sock = fd; syslogd_sock = fd;
debug_printf ("found /dev/log, fd = %d, type = %s", debug_printf ("found /dev/log, fd = %d, type = %s",