Fix Windows build.

This commit is contained in:
Sam Hocevar 2021-02-14 00:49:31 +01:00
parent a1d2c297ba
commit a5905bbcea
3 changed files with 6 additions and 0 deletions

View File

@ -33,6 +33,9 @@
<ClInclude Include="src\rinetd.h" />
<ClInclude Include="src\types.h" />
</ItemGroup>
<ItemGroup>
<None Include="src\parse.peg" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{3F1D9D58-3205-48E9-9C93-557291A45D74}</ProjectGuid>

View File

@ -12,6 +12,8 @@
/* Define this to a reasonably large value */
# define FD_SETSIZE 4096
# include <winsock2.h>
# include <ws2ipdef.h>
# include <ws2tcpip.h>
# include <windows.h>
#else
# include <sys/types.h>

View File

@ -654,6 +654,7 @@ static void handleAccept(ServerInfo const *srv)
SOCKET nfd;
if (srv->fromProto == protoTcp) {
/* In TCP mode, get remote address using accept(). */
// FIXME IPv6: need to reuse addrlen from the bind() call
nfd = accept(srv->fd, &addr, &addrlen);
if (nfd == INVALID_SOCKET) {
syslog(LOG_ERR, "accept(%llu): %m\n", (long long unsigned int)srv->fd);