]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
set hostname var sooner
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 1 Sep 2009 17:48:11 +0000 (17:48 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 1 Sep 2009 17:48:11 +0000 (17:48 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14718 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_console.c

index e3cafa9ada2ecb59e255b682930f71a3a207474a..5a071a18f19081fc1cfceff48151da315083ca56 100644 (file)
@@ -431,8 +431,6 @@ static unsigned char console_f12key(EditLine * el, int ch)
 char *prompt(EditLine * e)
 {
        if (*prompt_str == '\0') {
-               gethostname(hostname, sizeof(hostname));
-               switch_core_set_variable("hostname", hostname);
                switch_snprintf(prompt_str, sizeof(prompt_str), "freeswitch@%s> ", hostname);
        }
 
@@ -739,6 +737,8 @@ SWITCH_DECLARE(void) switch_console_loop(void)
        switch_threadattr_t *thd_attr = NULL;
        switch_memory_pool_t *pool;
 
+       gethostname(hostname, sizeof(hostname));
+
        if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Pool Failure\n");
                return;