change order of headers and leave out wireless checking on osx for now

This commit is contained in:
walker0643 2018-07-03 23:09:00 -04:00
parent 6761528e0b
commit b84202aa9a
2 changed files with 14 additions and 7 deletions

View File

@ -1,18 +1,23 @@
#include <string> #include <net/if.h>
#include <cstring>
#include <unistd.h>
#include <sys/ioctl.h>
#include <linux/wireless.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "SocketResource.h" #include "SocketResource.h"
#include "IfAddrsResource.h" #include "IfAddrsResource.h"
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#ifdef __linux__
#include <linux/wireless.h>
#endif
#include <string>
#include <cstring>
namespace Debauchee namespace Debauchee
{ {
static bool is_wireless(const char * ifname) static bool is_wireless(const char * ifname)
{ {
#ifdef __linux__
if (ifname) { if (ifname) {
SocketResource fd(AF_INET, SOCK_STREAM, 0); SocketResource fd(AF_INET, SOCK_STREAM, 0);
if (fd.is_valid()) { if (fd.is_valid()) {
@ -21,6 +26,7 @@ static bool is_wireless(const char * ifname)
return ioctl(fd, SIOCGIWMODE, req) >= 0; return ioctl(fd, SIOCGIWMODE, req) >= 0;
} }
} }
#endif
return false; return false;
} }

View File

@ -1,5 +1,6 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <unistd.h>
namespace Debauchee namespace Debauchee
{ {