Query hostname after initializing L&B API.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Tue, 14 Dec 2010 15:07:55 +0000 (15:07 +0000)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Tue, 14 Dec 2010 15:07:55 +0000 (15:07 +0000)
org.glite.lb.server/src/bkserverd.c

index f0a2e87..2f50e09 100644 (file)
@@ -414,10 +414,6 @@ int main(int argc, char *argv[])
        name = strrchr(argv[0],'/');
        if (name) name++; else name = argv[0];
 
-       memset(host, 0, sizeof host);
-       edg_wll_gss_gethostname(host,sizeof host);
-       host[sizeof host - 1] = 0;
-
        asprintf(&port, "%d", GLITE_JOBID_DEFAULT_PORT);
 #ifdef GLITE_LB_SERVER_WITH_WS
        asprintf(&ws_port, "%d", GLITE_JOBID_DEFAULT_PORT+3);
@@ -431,6 +427,10 @@ int main(int argc, char *argv[])
        purge_timeout[EDG_WLL_JOB_CANCELLED] = 60*60*24*7;
        edg_wll_InitContext(&ctx);
 
+       memset(host, 0, sizeof host);
+       edg_wll_gss_gethostname(host,sizeof host);
+       host[sizeof host - 1] = 0;
+
        while ((opt = getopt_long(argc,argv,get_opt_string,opts,NULL)) != EOF) switch (opt) {
                case 'A': enable_lcas = 1; break;
                case 'a': fake_host = strdup(optarg); break;