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

Diff for /pegasus/src/Pegasus/Common/SystemUnix.cpp between version 1.112 and 1.113

version 1.112, 2005/11/02 22:03:17 version 1.113, 2005/11/21 10:03:05
Line 73 
Line 73 
 #endif #endif
  
 #ifdef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM #ifdef PEGASUS_PLATFORM_ZOS_ZSERIES_IBM
   #define _OPEN_SYS_SOCK_IPV6
   #include <sys/socket.h>
 #include <arpa/inet.h> #include <arpa/inet.h>
 #include <__ftp.h>  //#include <__ftp.h>
   #define _OPEN_SYS_EXT
   #include <sys/ps.h>
 #endif #endif
  
 #if defined(PEGASUS_USE_SYSLOGS) #if defined(PEGASUS_USE_SYSLOGS)
Line 588 
Line 592 
     return fqName;     return fqName;
 #elif defined(PEGASUS_OS_ZOS) #elif defined(PEGASUS_OS_ZOS)
     char hostName[PEGASUS_MAXHOSTNAMELEN + 1];     char hostName[PEGASUS_MAXHOSTNAMELEN + 1];
     char *domainName;  
     String fqName;     String fqName;
       struct addrinfo *resolv;
       struct addrinfo hint;
       struct hostent *he;
     // receive short name of the local host     // receive short name of the local host
     if (gethostname(hostName, sizeof(hostName)) != 0)      if (gethostname(hostName, PEGASUS_MAXHOSTNAMELEN) != 0)
     {     {
         return String::EMPTY;         return String::EMPTY;
     }     }
     hostName[sizeof(hostName)-1] = 0;      resolv = new struct addrinfo;
     // get domain name of the local host      hint.ai_flags = AI_CANONNAME;
     domainName= __ipDomainName();      hint.ai_family = AF_UNSPEC; // any family
     if (domainName == 0)      hint.ai_socktype = 0;       // any socket type
       hint.ai_protocol = 0;       // any protocol
       int success = getaddrinfo(hostName,
                   NULL,
                   &hint,
                   &resolv);
       if (success==0)
       {
           // assign fully qualified hostname
           fqName.assign(resolv->ai_canonname);
       } else
     {     {
         return String::EMPTY;          if ((he = gethostbyname(hostName)))
           {
               strcpy (hostName, he->h_name);
     }     }
     // build fully qualified hostname          // assign hostName
           // if gethostbyname was successful assign that result
           // else assign unqualified hostname
     fqName.assign(hostName);     fqName.assign(hostName);
     fqName.append(".");      }
     fqName.append(domainName);      freeaddrinfo(resolv);
       delete resolv;
  
     return fqName;     return fqName;
 #else #else
Line 760 
Line 781 
         //Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::WARNING,         //Logger::put(Logger::STANDARD_LOG, "CIMServer", Logger::WARNING,
         //                          errorMsg);         //                          errorMsg);
     }     }
   #elif defined(PEGASUS_OS_ZOS)
       char effective_username[9];
       __getuserid(effective_username, 9);
       __etoa_l(effective_username,9);
       userName.assign(effective_username);
       return userName;
 #else #else
     //     //
     //  get the currently logged in user's UID.     //  get the currently logged in user's UID.


Legend:
Removed from v.1.112  
changed lines
  Added in v.1.113

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2