]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_ladspa: Set setenv() overwrite flag to replace empty LADSPA_PATH variables.
authorStefan Knoblich <s.knoblich@axsentis.de>
Sun, 3 Jul 2011 23:10:11 +0000 (01:10 +0200)
committerStefan Knoblich <s.knoblich@axsentis.de>
Sun, 3 Jul 2011 23:18:51 +0000 (01:18 +0200)
For complete putenv()-like behaviour.

Further investigation on why putenv() caused EFAULTs on execve() and
segfaults on reload:

putenv(3):

   "The string pointed to by string becomes part of the environment,
    so altering the string changes the environment."

setenv(3):

   "This function makes copies of the strings pointed to by name and value
    (by contrast with putenv(3))."

Signed-off-by: Stefan Knoblich <s.knoblich@axsentis.de>
src/mod/applications/mod_ladspa/mod_ladspa.c

index 0e399818eb888b6f365c722010ce9d1b91ec97ba..968f2d7879cbc329402dc856dd1534ceee786c25 100644 (file)
@@ -631,9 +631,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_ladspa_load)
 
        if (zstr(path)) {
                if (switch_directory_exists("/usr/lib64/ladspa/", pool) == SWITCH_STATUS_SUCCESS) {
-                       setenv("LADSPA_PATH", "/usr/lib64/ladspa/:/usr/local/lib/ladspa", 0);
+                       setenv("LADSPA_PATH", "/usr/lib64/ladspa/:/usr/local/lib/ladspa", 1);
                } else if (switch_directory_exists("/usr/lib/ladspa/", pool) == SWITCH_STATUS_SUCCESS) {
-                       setenv("LADSPA_PATH", "/usr/lib/ladspa/:/usr/local/lib/ladspa", 0);
+                       setenv("LADSPA_PATH", "/usr/lib/ladspa/:/usr/local/lib/ladspa", 1);
                }
        }