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:
authorCorinna Vinschen <corinna@vinschen.de>2001-10-30 14:48:36 +0300
committerCorinna Vinschen <corinna@vinschen.de>2001-10-30 14:48:36 +0300
commit05230a4a2907989b8d11e5ff9aa707dec1bbb38f (patch)
treeac3c48353f2e9bda711ec319520d85031975e843 /winsup/cygwin/fhandler_socket.cc
parentfc79ce17c732e039361c0f85c2b2e31446c19991 (diff)
* fhandler_socket.cc (fhandler_socket::close): Add error handling.
Fixed ChangeLog entries.
Diffstat (limited to 'winsup/cygwin/fhandler_socket.cc')
-rw-r--r--winsup/cygwin/fhandler_socket.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index 638611876..95793b4ab 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -289,9 +289,14 @@ fhandler_socket::close ()
setsockopt (get_socket (), SOL_SOCKET, SO_LINGER,
(const char *)&linger, sizeof linger);
- while (closesocket (get_socket ())
+ while ((res = closesocket (get_socket ()))
&& WSAGetLastError () == WSAEWOULDBLOCK)
continue;
+ if (res)
+ {
+ set_winsock_errno ();
+ res = -1;
+ }
close_secret_event ();