]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11781 [test] log reason for core load failure
authorChris Rienzo <chris@signalwire.com>
Sun, 21 Apr 2019 16:11:08 +0000 (12:11 -0400)
committerAndrey Volk <andywolk@gmail.com>
Tue, 9 Jul 2019 15:27:12 +0000 (19:27 +0400)
src/include/test/switch_test.h

index 88491054e1e89c477ad7c996411aa6d7a5b3b975..3ac6f1c635c8e3680474a2852a0c53b1b7d39898 100644 (file)
@@ -68,6 +68,7 @@ static char *fst_getenv_default(const char *env, char *default_value, switch_boo
  */
 static switch_status_t fst_init_core_and_modload(const char *confdir, const char *basedir, int minimal)
 {
+       switch_status_t status;
        const char *err;
        // Let FreeSWITCH core pick these
        //SWITCH_GLOBAL_dirs.base_dir = strdup("/usr/local/freeswitch");
@@ -112,12 +113,19 @@ static switch_status_t fst_init_core_and_modload(const char *confdir, const char
        switch_core_set_globals();
 
        if (!minimal) {
-               switch_status_t status = switch_core_init_and_modload(0, SWITCH_TRUE, &err);
+               status = switch_core_init_and_modload(0, SWITCH_TRUE, &err);
                switch_sleep(1 * 1000000);
                switch_core_set_variable("sound_prefix", "." SWITCH_PATH_SEPARATOR);
+               if (status != SWITCH_STATUS_SUCCESS && err) {
+                       fprintf(stderr, "%s", err);
+               }
                return status;
        }
-       return switch_core_init(SCF_MINIMAL, SWITCH_TRUE, &err);
+       status = switch_core_init(SCF_MINIMAL, SWITCH_TRUE, &err);
+       if (status != SWITCH_STATUS_SUCCESS && err) {
+               fprintf(stderr, "%s", err);
+       }
+       return status;
 }
 
 /**