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

Diff for /pegasus/src/Pegasus/Common/System.cpp between version 1.23.2.2 and 1.24

version 1.23.2.2, 2005/01/27 13:08:56 version 1.24, 2005/01/17 15:41:44
Line 159 
Line 159 
   return dirname;   return dirname;
 } }
  
   String System::getHostIP(const String &hostName)
   {
       struct hostent * phostent;
       struct in_addr   inaddr;
       String ipAddress = String::EMPTY;
   
       if ((phostent = ::gethostbyname((const char *)hostName.getCString())) != NULL)
       {
           ::memcpy( &inaddr, phostent->h_addr,4);
   #ifdef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM
           char * gottenIPAdress = NULL;
           gottenIPAdress = ::inet_ntoa( inaddr );
           __etoa(gottenIPAdress);
           if (gottenIPAdress != NULL)
           {
               ipAddress.assign(gottenIPAdress);
           }
   #else
           ipAddress = ::inet_ntoa( inaddr );
   #endif
       }
       return ipAddress;
   }
  
 // ------------------------------------------------------------------------ // ------------------------------------------------------------------------
 // Convert a hostname into a a single host unique integer representation // Convert a hostname into a a single host unique integer representation


Legend:
Removed from v.1.23.2.2  
changed lines
  Added in v.1.24

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2