Moved get_libdir function to its own file.
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
if(BUILD_TESTS OR BUILD_TOOLS)
|
if(BUILD_TESTS OR BUILD_TOOLS)
|
||||||
add_library(fullcore STATIC adminusers.c atomic.c config.c buffer.c dbusers.c dcb.c filter.c gwbitmask.c gw_utils.c hashtable.c hint.c housekeeper.c load_utils.c memlog.c modutil.c monitor.c poll.c resultset.c secrets.c server.c service.c session.c spinlock.c thread.c users.c utils.c)
|
add_library(fullcore STATIC adminusers.c atomic.c config.c buffer.c dbusers.c dcb.c filter.c gwbitmask.c gw_utils.c hashtable.c hint.c housekeeper.c load_utils.c memlog.c modutil.c monitor.c poll.c resultset.c secrets.c server.c service.c session.c spinlock.c thread.c users.c utils.c gwdirs.c)
|
||||||
if(WITH_JEMALLOC)
|
if(WITH_JEMALLOC)
|
||||||
target_link_libraries(fullcore ${JEMALLOC_LIBRARIES})
|
target_link_libraries(fullcore ${JEMALLOC_LIBRARIES})
|
||||||
elseif(WITH_TCMALLOC)
|
elseif(WITH_TCMALLOC)
|
||||||
@ -12,7 +12,7 @@ add_executable(maxscale atomic.c buffer.c spinlock.c gateway.c
|
|||||||
gw_utils.c utils.c dcb.c load_utils.c session.c service.c server.c
|
gw_utils.c utils.c dcb.c load_utils.c session.c service.c server.c
|
||||||
poll.c config.c users.c hashtable.c dbusers.c thread.c gwbitmask.c
|
poll.c config.c users.c hashtable.c dbusers.c thread.c gwbitmask.c
|
||||||
monitor.c adminusers.c secrets.c filter.c modutil.c hint.c
|
monitor.c adminusers.c secrets.c filter.c modutil.c hint.c
|
||||||
housekeeper.c memlog.c resultset.c)
|
housekeeper.c memlog.c resultset.c gwdirs.c)
|
||||||
|
|
||||||
if(WITH_JEMALLOC)
|
if(WITH_JEMALLOC)
|
||||||
target_link_libraries(maxscale ${JEMALLOC_LIBRARIES})
|
target_link_libraries(maxscale ${JEMALLOC_LIBRARIES})
|
||||||
|
|||||||
@ -129,11 +129,7 @@ static bool datadir_defined = false; /*< If the datadir was already set */
|
|||||||
/* The data directory we created for this gateway instance */
|
/* The data directory we created for this gateway instance */
|
||||||
static char pidfile[PATH_MAX+1] = "";
|
static char pidfile[PATH_MAX+1] = "";
|
||||||
|
|
||||||
static char* configdir = NULL;
|
|
||||||
static char* logdir = NULL;
|
|
||||||
static char* libdir = NULL;
|
|
||||||
static char* cachedir = NULL;
|
|
||||||
static char* langdir = NULL;
|
|
||||||
/**
|
/**
|
||||||
* exit flag for log flusher.
|
* exit flag for log flusher.
|
||||||
*/
|
*/
|
||||||
@ -200,14 +196,7 @@ static bool resolve_maxscale_homedir(
|
|||||||
|
|
||||||
static char* check_dir_access(char* dirname,bool,bool);
|
static char* check_dir_access(char* dirname,bool,bool);
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the directory with all the modules.
|
|
||||||
* @return The module directory
|
|
||||||
*/
|
|
||||||
char* get_libdir()
|
|
||||||
{
|
|
||||||
return libdir;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Handler for SIGHUP signal. Reload the configuration for the
|
* Handler for SIGHUP signal. Reload the configuration for the
|
||||||
* gateway.
|
* gateway.
|
||||||
|
|||||||
10
server/core/gwdirs.c
Normal file
10
server/core/gwdirs.c
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#include <gwdirs.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the directory with all the modules.
|
||||||
|
* @return The module directory
|
||||||
|
*/
|
||||||
|
char* get_libdir()
|
||||||
|
{
|
||||||
|
return libdir?libdir:(char*)default_libdir;
|
||||||
|
}
|
||||||
@ -19,6 +19,8 @@
|
|||||||
* Copyright MariaDB Corporation Ab 2015
|
* Copyright MariaDB Corporation Ab 2015
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
/** Default file locations, configured by CMake */
|
/** Default file locations, configured by CMake */
|
||||||
static const char* default_cnf_fname = "MaxScale.cnf";
|
static const char* default_cnf_fname = "MaxScale.cnf";
|
||||||
static const char* default_configdir = "/etc/";
|
static const char* default_configdir = "/etc/";
|
||||||
@ -30,4 +32,12 @@ static const char* default_cachedir = "/var/cache/maxscale/";
|
|||||||
static const char* default_langdir = "/usr/share/mysql/english/"; /*< This is where the MariaDB
|
static const char* default_langdir = "/usr/share/mysql/english/"; /*< This is where the MariaDB
|
||||||
* server installs errmsg.sys */
|
* server installs errmsg.sys */
|
||||||
|
|
||||||
|
static char* configdir = NULL;
|
||||||
|
static char* logdir = NULL;
|
||||||
|
static char* libdir = NULL;
|
||||||
|
static char* cachedir = NULL;
|
||||||
|
static char* langdir = NULL;
|
||||||
|
|
||||||
|
char* get_libdir();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user