summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/fhandler_socket.cc31
2 files changed, 20 insertions, 16 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index a7464a14c..13286903f 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2003-01-28 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_socket.cc (fhandler_socket::accept): On successful execution
+ set connection state of returned socket to CONNECTED.
+
2003-01-27 Christopher Faylor <cgf@redhat.com>
* passwd.cc (pwdgrp::parse_passwd): Be more unforgiving about
diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc
index 30ff64cf9..a3cbdd738 100644
--- a/winsup/cygwin/fhandler_socket.cc
+++ b/winsup/cygwin/fhandler_socket.cc
@@ -484,6 +484,7 @@ fhandler_socket::accept (struct sockaddr *peer, int *len)
WSAEVENT ev[2] = { WSA_INVALID_EVENT, signal_arrived };
BOOL secret_check_failed = FALSE;
BOOL in_progress = FALSE;
+ cygheap_fdnew res_fd;
/* Allows NULL peer and len parameters. */
struct sockaddr_in peer_dummy;
@@ -592,22 +593,20 @@ fhandler_socket::accept (struct sockaddr *peer, int *len)
}
}
- {
- cygheap_fdnew res_fd;
- if (res_fd < 0)
- /* FIXME: what is correct errno? */;
- else if ((SOCKET) res == (SOCKET) INVALID_SOCKET)
- 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;
- }
- }
+ if (res_fd < 0)
+ /* FIXME: what is correct errno? */;
+ else if ((SOCKET) res == (SOCKET) INVALID_SOCKET)
+ 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_fh->set_connect_state (CONNECTED);
+ res = res_fd;
+ }
done:
if (ev[0] != WSA_INVALID_EVENT)