(file) Return to InteropProvider.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / ControlProviders / InteropProvider

Diff for /pegasus/src/Pegasus/ControlProviders/InteropProvider/InteropProvider.cpp between version 1.12.2.1 and 1.12.2.2

version 1.12.2.1, 2005/01/20 14:10:12 version 1.12.2.2, 2005/01/27 13:08:56
Line 292 
Line 292 
 */ */
 String _getHostAddress(String hostName) String _getHostAddress(String hostName)
 { {
   String ipAddress;    // set default address
     String ipAddress("127.0.0.1");
  
   if (hostName == String::EMPTY)   if (hostName == String::EMPTY)
         hostName = System::getHostName();         hostName = System::getHostName();
  
   if ((ipAddress = System::getHostIP(hostName)) == String::EMPTY)    struct hostent * phostent;
     struct in_addr   inaddr;
   
     if ((phostent = ::gethostbyname((const char *)hostName.getCString())) != NULL)
   {   {
       // set default address if everything else failed       ::memcpy( &inaddr, phostent->h_addr,4);
       ipAddress = String("127.0.0.1");        ipAddress = ::inet_ntoa( inaddr );
   }   }
   return ipAddress;   return ipAddress;
 } }


Legend:
Removed from v.1.12.2.1  
changed lines
  Added in v.1.12.2.2

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2