mod_ladspa: Set setenv() overwrite flag to replace empty LADSPA_PATH variables.

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>
This commit is contained in:
Stefan Knoblich 2011-07-04 01:10:11 +02:00
parent 724d7f1649
commit b6826180f3

View 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);
}
}