Add the same crutch that tabled has, to help with misconfigured build
machines.

Signed-off-by: Pete Zaitcev <[email protected]>

diff -urp -X dontdiff chunkd/server/config.c chunkd-force/server/config.c
--- chunkd/server/config.c      2009-09-17 12:13:12.150697912 -0600
+++ chunkd-force/server/config.c        2009-09-29 15:01:38.626224517 -0600
@@ -256,6 +256,12 @@ static void cfg_elm_end (GMarkupParseCon
                cc->text = NULL;
        }
 
+       else if (!strcmp(element_name, "ForceHost") && cc->text) {
+               free(chunkd_srv.ourhost);
+               chunkd_srv.ourhost = cc->text;
+               cc->text = NULL;
+       }
+
        else if (!strcmp(element_name, "Path") && cc->text) {
                if (stat(cc->text, &st) < 0) {
                        applog(LOG_ERR, "stat(2) cfgfile Path '%s' failed: %s",
diff -urp -X dontdiff chunkd/server/server.c chunkd-force/server/server.c
--- chunkd/server/server.c      2009-09-17 12:13:12.158754062 -0600
+++ chunkd-force/server/server.c        2009-09-29 15:00:33.946198861 -0600
@@ -1284,7 +1284,11 @@ int main (int argc, char *argv[])
         * early as possible, so that tunables are available.
         */
        read_config();
-       chunkd_srv.ourhost = get_hostname();
+       if (!chunkd_srv.ourhost)
+               chunkd_srv.ourhost = get_hostname();
+       else if (debugging)
+               applog(LOG_INFO, "Forcing local hostname to %s",
+                      chunkd_srv.ourhost);
 
        /*
         * For example, backgrounding and PID file should be done early
diff -urp -X dontdiff chunkd/test/server-test.cfg 
chunkd-force/test/server-test.cfg
--- chunkd/test/server-test.cfg 2009-09-17 12:13:12.175697488 -0600
+++ chunkd-force/test/server-test.cfg   2009-09-29 15:08:09.520239669 -0600
@@ -1,4 +1,5 @@
 
+<ForceHost>localhost.localdomain</ForceHost>
 <SSL>
        <PrivateKey>ssl-key.pem</PrivateKey>
        <Cert>ssl-cert.pem</Cert>
--
To unsubscribe from this list: send the line "unsubscribe hail-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to