--- a/libpurple/win32/libc_interface.c Fri Feb 12 23:47:53 2021 -0600 +++ b/libpurple/win32/libc_interface.c Sat Feb 13 03:58:05 2021 -0600 @@ -98,59 +98,6 @@ }/*end switch*/ } -/* sys/ioctl.h */ -int wpurple_ioctl(int fd, int command, void* val) { - switch( command ) { - case FIONBIO: - { - if (ioctlsocket(fd, FIONBIO, (unsigned long *)val) == SOCKET_ERROR) { - errno = WSAGetLastError(); - return -1; - } - return 0; - } - case SIOCGIFCONF: - { - INTERFACE_INFO InterfaceList[20]; - unsigned long nBytesReturned; - if (WSAIoctl(fd, SIO_GET_INTERFACE_LIST, - 0, 0, &InterfaceList, - sizeof(InterfaceList), &nBytesReturned, - 0, 0) == SOCKET_ERROR) { - errno = WSAGetLastError(); - return -1; - } else { - int i; - struct ifconf *ifc = val; - char *tmp = ifc->ifc_buf; - int nNumInterfaces = - nBytesReturned / sizeof(INTERFACE_INFO); - for (i = 0; i < nNumInterfaces; i++) { - INTERFACE_INFO ii = InterfaceList[i]; - struct ifreq *ifr = (struct ifreq *) tmp; - struct sockaddr_in *sa = (struct sockaddr_in *) &ifr->ifr_addr; - - sa->sin_family = ii.iiAddress.AddressIn.sin_family; - sa->sin_port = ii.iiAddress.AddressIn.sin_port; - sa->sin_addr.s_addr = ii.iiAddress.AddressIn.sin_addr.s_addr; - tmp += sizeof(struct ifreq); - - /* Make sure that we can fit in the original buffer */ - if (tmp >= (ifc->ifc_buf + ifc->ifc_len + sizeof(struct ifreq))) { - break; - } - } - /* Replace the length with the actually used length */ - ifc->ifc_len = ifc->ifc_len - (ifc->ifc_buf - tmp); - return 0; - } - } - default: - errno = EINVAL; - return -1; - }/*end switch*/ -} - /* netdb.h */ struct hostent* wpurple_gethostbyname(const char *name) { struct hostent *hp;