pidgin/pidgin

Remove unused Windows ioctl wrapper.

2021-02-13, Elliott Sales de Andrade
75794647db18
Parents 2214cc7b95ca
Children 83ce555aeb47
Remove unused Windows ioctl wrapper.

Testing Done:
Compile only.

Reviewed at https://reviews.imfreedom.org/r/505/
--- a/libpurple/network.c Fri Feb 12 23:47:53 2021 -0600
+++ b/libpurple/network.c Sat Feb 13 03:58:05 2021 -0600
@@ -29,7 +29,6 @@
#include <resolv.h>
#include <netinet/in.h>
#include <net/if.h>
-#include <sys/ioctl.h>
#else
#include <nspapi.h>
#endif
--- a/libpurple/protocols/zephyr/sysdep.h Fri Feb 12 23:47:53 2021 -0600
+++ b/libpurple/protocols/zephyr/sysdep.h Sat Feb 13 03:58:05 2021 -0600
@@ -68,9 +68,6 @@
# ifdef HAVE_SGTTY_H
# include <sgtty.h>
# endif
-# ifdef HAVE_SYS_IOCTL_H
-# include <sys/ioctl.h>
-# endif
# endif
#endif
--- a/libpurple/stun.c Fri Feb 12 23:47:53 2021 -0600
+++ b/libpurple/stun.c Sat Feb 13 03:58:05 2021 -0600
@@ -26,7 +26,6 @@
#ifndef _WIN32
#include <net/if.h>
-#include <sys/ioctl.h>
#endif
#include <gio/gio.h>
--- 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;
--- a/libpurple/win32/libc_interface.h Fri Feb 12 23:47:53 2021 -0600
+++ b/libpurple/win32/libc_interface.h Sat Feb 13 03:58:05 2021 -0600
@@ -49,10 +49,6 @@
#define getsockname( socket, addr, lenptr ) \
wpurple_getsockname( socket, addr, lenptr )
-/* sys/ioctl.h */
-#define ioctl( fd, command, val ) \
-wpurple_ioctl( fd, command, val )
-
/* fcntl.h */
#define fcntl( fd, command, ... ) \
wpurple_fcntl( fd, command, ##__VA_ARGS__ )
--- a/libpurple/win32/libc_internal.h Fri Feb 12 23:47:53 2021 -0600
+++ b/libpurple/win32/libc_internal.h Sat Feb 13 03:58:05 2021 -0600
@@ -38,10 +38,6 @@
#define F_SETFL 4
#define O_NONBLOCK 04000
-/* sys/ioctl.h */
-#define SIOCGIFCONF 0x8912 /* get iface list */
-int wpurple_ioctl(int fd, int command, void* opt);
-
/* net/if.h */
struct ifreq
{
--- a/meson.build Fri Feb 12 23:47:53 2021 -0600
+++ b/meson.build Sat Feb 13 03:58:05 2021 -0600
@@ -688,7 +688,7 @@
conf.set('HAVE_' + func.to_upper(),
compiler.has_function(func))
endforeach
-foreach header : 'sgtty.h sys/cdefs.h sys/file.h sys/filio.h sys/ioctl.h sys/msgbuf.h sys/select.h sys/wait.h termios.h'.split()
+foreach header : 'sgtty.h sys/cdefs.h sys/file.h sys/filio.h sys/msgbuf.h sys/select.h sys/wait.h termios.h'.split()
conf.set('HAVE_' + header.to_upper().underscorify(),
compiler.has_header(header))
endforeach