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/net.cc')
-rw-r--r--winsup/cygwin/net.cc15
1 files changed, 3 insertions, 12 deletions
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index 6b63f4b0d..e55dd03ed 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -844,8 +844,9 @@ cygwin_getsockopt (int fd, int level, int optname, void *optval,
optname = convert_ws1_ip_optname (optname);
res = getsockopt (fh->get_socket (), level, optname, (char *) optval,
(int *) optlen);
-
- if (level == SOL_SOCKET)
+ if (res == SOCKET_ERROR)
+ set_winsock_errno ();
+ else if (level == SOL_SOCKET)
{
switch (optname)
{
@@ -873,16 +874,6 @@ cygwin_getsockopt (int fd, int level, int optname, void *optval,
break;
}
}
- if (optname == SO_ERROR)
- {
- int *e = (int *) optval;
-
- debug_printf ("WinSock SO_ERROR = %d", *e);
- *e = find_winsock_errno (*e);
- }
-
- if (res)
- set_winsock_errno ();
}
syscall_printf ("%d = getsockopt (%d, %d, 0x%x, %p, %p)",