300
300
fs::path basedir(PREFIX);
301
301
fs::path pid_file;
302
fs::path secure_file_priv("");
302
fs::path secure_file_priv;
303
303
fs::path plugin_dir;
304
304
fs::path system_config_dir(SYSCONFDIR);
307
char *opt_tc_log_file;
306
const char *opt_tc_log_file;
308
307
const key_map key_map_empty(0);
309
308
key_map key_map_full(0); // Will be initialized later
382
std::string &getGlobHostname()
384
static std::string glob_hostname("localhost");
385
return glob_hostname;
388
void setServerHostname(const std::string &hostname)
390
getGlobHostname()= hostname;
394
const std::string &getServerHostname()
396
return getGlobHostname();
379
static std::string g_hostname= "localhost";
381
const std::string& getServerHostname()
399
386
/****************************************************************************
1015
1002
ifstream input_defaults_file(file_location.file_string().c_str());
1017
po::parsed_options file_parsed=
1018
dpo::parse_config_file(input_defaults_file, full_options, true);
1019
vector<string> file_unknown=
1020
po::collect_unrecognized(file_parsed.options, po::include_positional);
1004
po::parsed_options file_parsed= dpo::parse_config_file(input_defaults_file, full_options, true);
1005
vector<string> file_unknown= po::collect_unrecognized(file_parsed.options, po::include_positional);
1022
for (vector<string>::iterator it= file_unknown.begin();
1023
it != file_unknown.end();
1007
for (vector<string>::iterator it= file_unknown.begin(); it != file_unknown.end(); ++it)
1026
string new_unknown_opt("--");
1027
new_unknown_opt.append(*it);
1009
string new_unknown_opt("--" + *it);
1029
1011
if (it == file_unknown.end())
1031
if ((*it) != "true")
1033
new_unknown_opt.push_back('=');
1034
new_unknown_opt.append(*it);
1014
new_unknown_opt += "=" + *it;
1036
1015
unknown_options.push_back(new_unknown_opt);
1038
1017
store(file_parsed, vm);
1042
static void compose_defaults_file_list(vector<string> in_options)
1021
static void compose_defaults_file_list(const vector<string>& in_options)
1044
BOOST_FOREACH(vector<string>::reference it, in_options)
1023
BOOST_FOREACH(const string& it, in_options)
1046
1025
fs::path p(it);
1047
1026
if (fs::is_regular_file(p))
1057
1036
int init_basic_variables(int argc, char **argv)
1060
1038
umask(((~internal::my_umask) & 0666));
1061
1039
decimal_zero.set_zero(); // set decimal_zero constant;
1062
1040
tzset(); // Set tzname
1064
curr_time= time(NULL);
1042
time_t curr_time= time(NULL);
1065
1043
if (curr_time == (time_t)-1)
1075
1053
char ret_hostname[FN_REFLEN];
1076
1054
if (gethostname(ret_hostname,sizeof(ret_hostname)) < 0)
1078
errmsg_printf(error::WARN,
1079
_("gethostname failed, using '%s' as hostname"),
1080
getServerHostname().c_str());
1056
errmsg_printf(error::WARN, _("gethostname failed, using '%s' as hostname"), getServerHostname().c_str());
1081
1057
pid_file= "drizzle";
1085
setServerHostname(ret_hostname);
1061
g_hostname= ret_hostname;
1086
1062
pid_file= getServerHostname();
1088
1064
pid_file.replace_extension(".pid");