diff -r 99ac65572b14 -r a5284ec02d61 sbsv2/raptor/util/talon/talon.c --- a/sbsv2/raptor/util/talon/talon.c Sun Feb 28 22:37:15 2010 +0000 +++ b/sbsv2/raptor/util/talon/talon.c Mon Mar 01 00:54:27 2010 +0200 @@ -137,7 +137,7 @@ att++; } while ( e < (VARNAMEMAX-1) && (isalnum(*att) || *att == '_')); envvarname[e] = '\0'; -/* DEBUG(("envvarname: %s\n", envvarname)); */ + /* DEBUG(("envvarname: %s\n", envvarname));*/ v = talon_getenv(envvarname); if (v) { @@ -344,15 +344,6 @@ recipe++; - /* Make sure that the agent's hostname can be put into the host attribute */ - char hostname[HOSTNAME_MAX]; - - if (0 != gethostname(hostname, HOSTNAME_MAX-1)) - { - hostname[0] = '\0'; - } - - talon_setenv("HOSTNAME", hostname); /* turn debugging on? */ @@ -366,6 +357,21 @@ DEBUG(("talon: recipe: %s\n", recipe)); + /* Make sure that the agent's hostname can be put into the host attribute */ + char hostname[HOSTNAME_MAX]; + int hostresult=0; + + + hostresult = gethostname(hostname, HOSTNAME_MAX-1); + if (0 != hostresult) + { + DEBUG(("talon: failed to get hostname: %d\n", hostresult)); + hostname[0] = '\0'; + } + + talon_setenv("HOSTNAME", hostname); + DEBUG(("talon: setenv: hostname: %s\n", hostname)); + char varname[VARNAMEMAX]; char varval[VARVALMAX];