Message-ID: <
20010427170036.K1372@Strawberry.COM>
SOCKS5_VERSION_NAME is the right symbol to detect
the presence of SOCKS5. (HAS_SOCKS5_INIT is telling whether
function called socks5_init() is available, and even that is
not universal, most SOCKS5 installations use SOCKSinit()).
p4raw-id: //depot/perl@9914
PerlIOStdio_close(PerlIO *f)
{
dTHX;
-#ifdef HAS_SOCKS5_INIT
+#ifdef SOCKS5_VERSION_NAME
int optval;
Sock_size_t optlen = sizeof(int);
#endif
FILE *stdio = PerlIOSelf(f,PerlIOStdio)->stdio;
return(
-#ifdef HAS_SOCKS5_INIT
+#ifdef SOCKS5_VERSION_NAME
(getsockopt(PerlIO_fileno(f), SOL_SOCKET, SO_TYPE, (void *)&optval, &optlen) < 0) ?
PerlSIO_fclose(stdio) :
close(PerlIO_fileno(f))