Added configurable executable file directory

This allows MaxScale to launch processes from the directory where
the `maxscale` executable is located.
This commit is contained in:
Markus Makela
2016-02-15 11:12:54 +02:00
parent 477197ff5b
commit a628fdcb17
7 changed files with 71 additions and 40 deletions

View File

@ -96,6 +96,18 @@ void set_libdir(char* param)
libdir = param;
}
/**
* Set the executable directory. Internal processes will look for executables
* from here.
* @param str Path to directory
*/
void set_execdir(char* param)
{
free(execdir);
clean_up_pathname(param);
execdir = param;
}
/**
* Get the directory with all the modules.
* @return The module directory
@ -158,3 +170,12 @@ char* get_langdir()
{
return langdir ? langdir : (char*) default_langdir;
}
/**
* Get the directory with the executables.
* @return The executables directory
*/
char* get_execdir()
{
return execdir ? execdir : (char*) default_execdir;
}