Changeset 51:1793615c41cb in rrlib_util


Ignore:
Timestamp:
06.03.2012 18:46:57 (8 years ago)
Author:
Tobias Föhst <foehst@…>
Branch:
default
Phase:
public
Rebase:
63623634323239353664333130386566306466313862343464306630353962626133363137636331
Message:

Tried to make host lookup a bit more robust

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sFileIOUtils.cpp

    r43 r51  
    296296{ 
    297297  //RRLIB_LOG_PRINTF(logging::eLL_USER, "sFileIOUtils::GetHostName() >>> started\n"); 
    298   std::string cmd = fqdn ? "hostname -f" : "hostname"; 
     298  std::string cmd = fqdn ? "hostname -f" : "hostname -s"; 
    299299  FILE * pipe = popen(cmd.c_str(), "r"); 
    300300  char buf[ 1024 ]; 
  • sFileIOUtils.h

    r34 r51  
    148148   * \param fqdn whether FQDN  (Fully  Qualified Domain Name) or short name shall be retrieved 
    149149   */ 
    150   static std::string GetHostName(bool fqdn = true); 
     150  static std::string GetHostName(bool fqdn = false); 
    151151 
    152152 
Note: See TracChangeset for help on using the changeset viewer.