* net.cc (cygwin_accept): Allow NULL peer and len parameters.
* include/cygwin/socket.h: Define socklen_t as int.
This commit is contained in:
parent
dce6f56397
commit
7eb971a561
|
@ -1,3 +1,8 @@
|
||||||
|
Fri Aug 3 14:02:00 2001 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* net.cc (cygwin_accept): Allow NULL peer and len parameters.
|
||||||
|
* include/cygwin/socket.h: Define socklen_t as int.
|
||||||
|
|
||||||
Fri Aug 3 13:04:00 2001 Corinna Vinschen <corinna@vinschen.de>
|
Fri Aug 3 13:04:00 2001 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* path.cc (fchdir): Set the fhandler's path to absolute value to
|
* path.cc (fchdir): Set the fhandler's path to absolute value to
|
||||||
|
|
|
@ -40,6 +40,10 @@ struct msghdr
|
||||||
int msg_accrightslen; /* Length of rights list */
|
int msg_accrightslen; /* Length of rights list */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef socklen_t
|
||||||
|
#define socklen_t int
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Socket types. */
|
/* Socket types. */
|
||||||
#define SOCK_STREAM 1 /* stream (connection) socket */
|
#define SOCK_STREAM 1 /* stream (connection) socket */
|
||||||
#define SOCK_DGRAM 2 /* datagram (conn.less) socket */
|
#define SOCK_DGRAM 2 /* datagram (conn.less) socket */
|
||||||
|
|
|
@ -900,6 +900,17 @@ cygwin_accept (int fd, struct sockaddr *peer, int *len)
|
||||||
fhandler_socket *sock = get (fd);
|
fhandler_socket *sock = get (fd);
|
||||||
if (sock)
|
if (sock)
|
||||||
{
|
{
|
||||||
|
/* Allows NULL peer and len parameters. */
|
||||||
|
struct sockaddr_in peer_dummy;
|
||||||
|
int len_dummy;
|
||||||
|
if (!peer)
|
||||||
|
peer = (struct sockaddr *) &peer_dummy;
|
||||||
|
if (!len)
|
||||||
|
{
|
||||||
|
len_dummy = sizeof (struct sockaddr_in);
|
||||||
|
len = &len_dummy;
|
||||||
|
}
|
||||||
|
|
||||||
/* accept on NT fails if len < sizeof (sockaddr_in)
|
/* accept on NT fails if len < sizeof (sockaddr_in)
|
||||||
* some programs set len to
|
* some programs set len to
|
||||||
* sizeof (name.sun_family) + strlen (name.sun_path) for UNIX domain
|
* sizeof (name.sun_family) + strlen (name.sun_path) for UNIX domain
|
||||||
|
|
Loading…
Reference in New Issue