Skip to content
This repository
Browse code

Revert "[droid] fix crash in network properties"

This reverts commit 398710e.
  • Loading branch information...
commit 47214abf672312c8c83f90f60f9b1b6df0606dea 1 parent b33d27e
authored August 15, 2012
23  xbmc/network/linux/NetworkLinux.cpp
@@ -51,6 +51,7 @@
51 51
 #include "NetworkLinux.h"
52 52
 #include "Util.h"
53 53
 #include "utils/log.h"
  54
+
54 55
 using namespace std;
55 56
 
56 57
 CNetworkInterfaceLinux::CNetworkInterfaceLinux(CNetworkLinux* network, CStdString interfaceName, char interfaceMacAddrRaw[6])
@@ -459,7 +460,7 @@ std::vector<CStdString> CNetworkLinux::GetNameServers(void)
459 460
 {
460 461
    std::vector<CStdString> result;
461 462
 
462  
-#if defined(TARGET_DARWIN)
  463
+#if defined(TARGET_DARWIN) || defined(__ANDROID__)
463 464
   //only finds the primary dns (0 :)
464 465
   FILE* pipe = popen("scutil --dns | grep \"nameserver\\[0\\]\" | tail -n1", "r");
465 466
   if (pipe)
@@ -477,26 +478,6 @@ std::vector<CStdString> CNetworkLinux::GetNameServers(void)
477 478
     }
478 479
     pclose(pipe);
479 480
   } 
480  
-#elif defined(TARGET_ANDROID)
481  
-  CSingleLock lock(m_critSection);
482  
-  //only finds the primary dns (0 :)
483  
-  FILE* pipe = popen("getprop net.dns1 | tail -n1", "r");
484  
-  if (pipe)
485  
-  {
486  
-    CStdString tmpStr;
487  
-    char buffer[256] = {'\0'};
488  
-    if (fread(buffer, sizeof(char), sizeof(buffer), pipe) > 0 && !ferror(pipe))
489  
-    {
490  
-      tmpStr = buffer;
491  
-      CLog::Log(LOGWARNING, "CNetworkLinux::GetNameServers: Got server: %s", tmpStr.c_str());
492  
-      result.push_back(tmpStr);
493  
-    }
494  
-    else
495  
-    {
496  
-      CLog::Log(LOGWARNING, "Unable to determine nameserver");
497  
-    }
498  
-    pclose(pipe);
499  
-  }
500 481
 #else
501 482
    res_init();
502 483
 
3  xbmc/network/linux/NetworkLinux.h
@@ -25,8 +25,6 @@
25 25
 #include <vector>
26 26
 #include "utils/StdString.h"
27 27
 #include "network/Network.h"
28  
-#include "threads/Thread.h"
29  
-#include "threads/CriticalSection.h"
30 28
 
31 29
 class CNetworkLinux;
32 30
 
@@ -91,7 +89,6 @@ class CNetworkLinux : public CNetwork
91 89
    void queryInterfaceList();
92 90
    std::vector<CNetworkInterface*> m_interfaces;
93 91
    int m_sock;
94  
-   CCriticalSection m_critSection;
95 92
 };
96 93
 
97 94
 #endif

0 notes on commit 47214ab

Please sign in to comment.
Something went wrong with that request. Please try again.