Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "[droid] fix crash in network properties"

This reverts commit 398710e.
  • Loading branch information...
commit 47214abf672312c8c83f90f60f9b1b6df0606dea 1 parent b33d27e
Cory Fields authored
View
23 xbmc/network/linux/NetworkLinux.cpp
@@ -51,6 +51,7 @@
#include "NetworkLinux.h"
#include "Util.h"
#include "utils/log.h"
+
using namespace std;
CNetworkInterfaceLinux::CNetworkInterfaceLinux(CNetworkLinux* network, CStdString interfaceName, char interfaceMacAddrRaw[6])
@@ -459,7 +460,7 @@ std::vector<CStdString> CNetworkLinux::GetNameServers(void)
{
std::vector<CStdString> result;
-#if defined(TARGET_DARWIN)
+#if defined(TARGET_DARWIN) || defined(__ANDROID__)
//only finds the primary dns (0 :)
FILE* pipe = popen("scutil --dns | grep \"nameserver\\[0\\]\" | tail -n1", "r");
if (pipe)
@@ -477,26 +478,6 @@ std::vector<CStdString> CNetworkLinux::GetNameServers(void)
}
pclose(pipe);
}
-#elif defined(TARGET_ANDROID)
- CSingleLock lock(m_critSection);
- //only finds the primary dns (0 :)
- FILE* pipe = popen("getprop net.dns1 | tail -n1", "r");
- if (pipe)
- {
- CStdString tmpStr;
- char buffer[256] = {'\0'};
- if (fread(buffer, sizeof(char), sizeof(buffer), pipe) > 0 && !ferror(pipe))
- {
- tmpStr = buffer;
- CLog::Log(LOGWARNING, "CNetworkLinux::GetNameServers: Got server: %s", tmpStr.c_str());
- result.push_back(tmpStr);
- }
- else
- {
- CLog::Log(LOGWARNING, "Unable to determine nameserver");
- }
- pclose(pipe);
- }
#else
res_init();
View
3  xbmc/network/linux/NetworkLinux.h
@@ -25,8 +25,6 @@
#include <vector>
#include "utils/StdString.h"
#include "network/Network.h"
-#include "threads/Thread.h"
-#include "threads/CriticalSection.h"
class CNetworkLinux;
@@ -91,7 +89,6 @@ class CNetworkLinux : public CNetwork
void queryInterfaceList();
std::vector<CNetworkInterface*> m_interfaces;
int m_sock;
- CCriticalSection m_critSection;
};
#endif
Please sign in to comment.
Something went wrong with that request. Please try again.