Skip to content

Commit

Permalink
recover lost GetLocalHostName code; remove added debugging code
Browse files Browse the repository at this point in the history
  • Loading branch information
John Vogt committed May 18, 2021
1 parent 47089f5 commit b807dc2
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/STAT_FrontEnd.C
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,6 @@ extern int gNumEdgeAttrs;

STAT_FrontEnd::STAT_FrontEnd()
{
char *pHangTime = getenv("STAT_FE_HANG_SECONDS");
if (pHangTime) {
int hangTime = atoi(pHangTime);
while (hangTime--) {
sleep(1);
}
}

int intRet;
char tmp[BUFSIZE], *envValue;
struct timeval timeStamp;
Expand Down Expand Up @@ -215,9 +207,16 @@ STAT_FrontEnd::STAT_FrontEnd()
statInitializeMergeFunctions();

/* Get the FE hostname */
intRet = gethostname(hostname_, BUFSIZE);
if (intRet != 0) {
printMsg(STAT_WARNING, __FILE__, __LINE__, "gethostname failed with error code %d\n", intRet);
string temp;
intRet = XPlat::NetUtils::GetLocalHostName(temp);
if (intRet == 0)
snprintf(hostname_, BUFSIZE, "%s", temp.c_str());
else
{
intRet = gethostname(hostname_, BUFSIZE);
if (intRet != 0) {
printMsg(STAT_WARNING, __FILE__, __LINE__, "gethostname failed with error code %d\n", intRet);
}
}

/* Initialize variables */
Expand Down

0 comments on commit b807dc2

Please sign in to comment.