Small follow-up improvement to
https://gitlab.com/openconnect/openconnect/-/merge_requests/320, which made
dumb_socketpair() able to use Unix-domain sockets, on those Windows versions
that support them albeit only with named paths.
This was suggested as a way to prevent the Windows dumb_socketpair()
implementation from leaving behind size-0 files, even if normally only in
temporary directories.
See original suggestion at
https://github.com/microsoft/WSL/issues/4240#issuecomment-
1027607891.
Signed-off-by: Daniel Lenski <dlenski@gmail.com>
goto fallback;
if (connect(socks[0], &a.addr, addrlen) == SOCKET_ERROR)
goto fallback;
+ if (domain == AF_UNIX)
+ DeleteFile(a.unaddr.sun_path); // Socket file no longer needed
socks[1] = accept(listener, NULL, NULL);
if (socks[1] == INVALID_SOCKET)