]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
get rid of more globals
authorMichael Jerris <mike@jerris.com>
Wed, 5 Dec 2007 03:05:29 +0000 (03:05 +0000)
committerMichael Jerris <mike@jerris.com>
Wed, 5 Dec 2007 03:05:29 +0000 (03:05 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6513 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/loggers/mod_logfile/mod_logfile.c

index 2ae5b776dde2db43a3d142de1c3d6b077c085473..f5b7c57a8d73cb79ac52a0cb49785001d1917667 100644 (file)
@@ -68,8 +68,6 @@ static logfile_profile_t *default_profile;
 
 static switch_status_t load_config(logfile_profile_t *profile, switch_xml_t xml);
 
-SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_logfile, default_profile->logfile);
-
 void process_levels(logfile_profile_t *profile, char *p)
 {
        int x, i, argc = 0;
@@ -255,8 +253,7 @@ static switch_status_t load_config(logfile_profile_t *profile, switch_xml_t xml)
                char *var = (char *) switch_xml_attr_soft(param, "name");
                char *val = (char *) switch_xml_attr_soft(param, "value");
                if (!strcmp(var, "logfile")) {
-                       set_global_logfile(val);
-               /* TODO: do this for multiple profiles */
+                       profile->logfile = strdup(val);
                } else if (!strcmp(var, "level")) {
                        process_levels(profile, val);
                } else if (!strcmp(var, "rollover")) {
@@ -270,8 +267,7 @@ static switch_status_t load_config(logfile_profile_t *profile, switch_xml_t xml)
        if (switch_strlen_zero(profile->logfile)) {
                char logfile[512];
                snprintf(logfile, sizeof(logfile), "%s%s%s", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR, "freeswitch.log");
-               /* TODO: Make this not global */
-               set_global_logfile(logfile);
+               profile->logfile = strdup(logfile);
        }
 
        return 0;