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:
authorChristopher Faylor <me@cgf.cx>2001-04-15 02:11:03 +0400
committerChristopher Faylor <me@cgf.cx>2001-04-15 02:11:03 +0400
commit266be1d8c9765d22bff62e79c5d396bc2f54fea4 (patch)
tree83156f2351cc47a32d1d7fdc950bd9a6ad6d4cdc /winsup/cygwin/net.cc
parente6b98fc8d6539f40aa34ce4964ae40305a5a52ca (diff)
* net.cc (cygwin_socket): Set SO_LINGER to small value so closed UNIX domain
sockets will not stay around. * select.cc (socket_cleanup): Set SO_LINGER to small value so closed dummy sockets do not stay around. Use correct value for second argument to shutdown.
Diffstat (limited to 'winsup/cygwin/net.cc')
-rw-r--r--winsup/cygwin/net.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index e089cd642..536505701 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -363,7 +363,12 @@ cygwin_socket (int af, int type, int protocol)
if (af == AF_INET)
name = (type == SOCK_STREAM ? "/dev/tcp" : "/dev/udp");
else
- name = (type == SOCK_STREAM ? "/dev/streamsocket" : "/dev/dgsocket");
+ {
+ name = (type == SOCK_STREAM ? "/dev/streamsocket" : "/dev/dgsocket");
+ /* Set LINGER with 0 timeout for hard close */
+ struct linger tmp = {1, 0}; /* On, 0 delay */
+ (void) setsockopt (soc, SOL_SOCKET, SO_LINGER, (char *)&tmp, sizeof(tmp));
+ }
fdsock (fd, name, soc)->set_addr_family (af);
res = fd;