# HG changeset patch # User timothy.murphy@nokia.com # Date 1267397667 -7200 # Node ID a5284ec02d6127d43847686895067e37acc8c942 # Parent 99ac65572b14d3fc489e4d7d4af2ca66cb4cd4d0 fix: remove unnecessary changes. Reorganise gethostname stuff so it can be debugged. diff -r 99ac65572b14 -r a5284ec02d61 sbsv2/raptor/lib/flm/taggedrules.mk --- a/sbsv2/raptor/lib/flm/taggedrules.mk Sun Feb 28 22:37:15 2010 +0000 +++ b/sbsv2/raptor/lib/flm/taggedrules.mk Mon Mar 01 00:54:27 2010 +0200 @@ -100,12 +100,11 @@ else -TALON_HOSTNAME_VAR:=$$HOSTNAME TALON_RECIPEATTRIBUTES:=\ name='$$RECIPE'\ target='$$TARGET'\ - host='$(TALON_HOSTNAME_VAR)'\ + host='$$HOSTNAME'\ layer='$$COMPONENT_LAYER'\ component='$$COMPONENT_NAME'\ bldinf='$$COMPONENT_META' mmp='$$PROJECT_META'\ 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];