X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e9670814f59ff30146eb4ea694a78a88bed014ae..815f65bd0f673965230ed915d794497a8818dd35:/src/unix/dialup.cpp diff --git a/src/unix/dialup.cpp b/src/unix/dialup.cpp index 08e4817d6e..2482dfb28a 100644 --- a/src/unix/dialup.cpp +++ b/src/unix/dialup.cpp @@ -336,8 +336,7 @@ wxDialUpManagerImpl::Dial(const wxString &isp, m_DialPId = (int)wxExecute(cmd, false, m_DialProcess); if(m_DialPId == 0) { - delete m_DialProcess; - m_DialProcess = NULL; + wxDELETE(m_DialProcess); return false; } else @@ -379,8 +378,7 @@ bool wxDialUpManagerImpl::EnableAutoCheckOnlineStatus(size_t nSeconds) bool rc = m_timer->Start(nSeconds*1000); if(! rc) { - delete m_timer; - m_timer = NULL; + wxDELETE(m_timer); } return rc; } @@ -390,15 +388,14 @@ void wxDialUpManagerImpl::DisableAutoCheckOnlineStatus() if(m_timer != NULL) { m_timer->Stop(); - delete m_timer; - m_timer = NULL; + wxDELETE(m_timer); } } void wxDialUpManagerImpl::SetWellKnownHost(const wxString& hostname, int portno) { - if(hostname.length() == 0) + if( hostname.empty() ) { m_BeaconHost = WXDIALUP_MANAGER_DEFAULT_BEACONHOST; m_BeaconPort = 80; @@ -407,7 +404,7 @@ void wxDialUpManagerImpl::SetWellKnownHost(const wxString& hostname, int portno) // does hostname contain a port number? wxString port = hostname.After(wxT(':')); - if(port.length()) + if( !port.empty() ) { m_BeaconHost = hostname.Before(wxT(':')); m_BeaconPort = wxAtoi(port); @@ -611,7 +608,10 @@ wxDialUpManagerImpl::CheckProcNet() while (fgets(output, 256, f) != NULL) { - if ( strstr(output, "eth") ) // network card + // Test for the known network interface names + if ( strstr(output, "eth") + || strstr(output, "wlan") + || strstr(output, "ath") ) { netDevice |= NetDevice_LAN; } @@ -645,7 +645,7 @@ wxDialUpManagerImpl::CheckIfconfig() // first time check for ifconfig location if ( m_CanUseIfconfig == -1 ) // unknown { - static const wxChar *ifconfigLocations[] = + static const wxChar *const ifconfigLocations[] = { wxT("/sbin"), // Linux, FreeBSD, Darwin wxT("/usr/sbin"), // SunOS, Solaris, AIX, HP-UX @@ -670,7 +670,7 @@ wxDialUpManagerImpl::CheckIfconfig() { wxLogNull ln; // suppress all error messages - wxASSERT_MSG( m_IfconfigPath.length(), + wxASSERT_MSG( !m_IfconfigPath.empty(), wxT("can't use ifconfig if it wasn't found") ); wxString tmpfile = wxFileName::CreateTempFileName( wxT("_wxdialuptest") ); @@ -684,7 +684,7 @@ wxDialUpManagerImpl::CheckIfconfig() cmd << wxT(" -a"); #elif defined(__LINUX__) || defined(__SGI__) // nothing to be added to ifconfig -#elif defined(__FREEBSD__) || defined(__DARWIN__) +#elif defined(__FREEBSD__) || defined(__DARWIN__) || defined(__QNX__) // add -l flag cmd << wxT(" -l"); #elif defined(__HPUX__) @@ -723,7 +723,7 @@ wxDialUpManagerImpl::CheckIfconfig() // dialup device under SunOS/Solaris hasModem = strstr(output.fn_str(),"ipdptp") != NULL; hasLAN = strstr(output.fn_str(), "hme") != NULL; -#elif defined(__LINUX__) || defined (__FREEBSD__) +#elif defined(__LINUX__) || defined (__FREEBSD__) || defined (__QNX__) hasModem = strstr(output.fn_str(),"ppp") // ppp || strstr(output.fn_str(),"sl") // slip || strstr(output.fn_str(),"pl"); // plip @@ -799,7 +799,8 @@ wxDialUpManagerImpl::NetConnection wxDialUpManagerImpl::CheckPing() defined(__LINUX__) || \ defined(__OSF__) || \ defined(__SGI__) || \ - defined(__VMS) + defined(__VMS) || \ + defined(__QNX__) cmd << wxT("-c 1 "); // only ping once #elif defined(__HPUX__) cmd << wxT("64 1 "); // only ping once (need also specify the packet size)