Fixed error on bad log directory.

This commit is contained in:
Markus Makela
2015-08-10 18:25:46 +03:00
parent 0abcf349ff
commit 37ea3a6224
2 changed files with 25 additions and 2 deletions

View File

@ -1164,19 +1164,30 @@ int main(int argc, char **argv)
{ {
set_logdir(tmp_path); set_logdir(tmp_path);
} }
else
{
succp = false;
}
break; break;
case 'N': case 'N':
if(handle_path_arg(&tmp_path,optarg,NULL,true,false)) if(handle_path_arg(&tmp_path,optarg,NULL,true,false))
{ {
set_langdir(tmp_path); set_langdir(tmp_path);
} }
else
{
succp = false;
}
break; break;
case 'P': case 'P':
if(handle_path_arg(&tmp_path,optarg,NULL,true,true)) if(handle_path_arg(&tmp_path,optarg,NULL,true,true))
{ {
set_piddir(tmp_path); set_piddir(tmp_path);
} }
else
{
succp = false;
}
break; break;
case 'D': case 'D':
sprintf(datadir,"%s",optarg); sprintf(datadir,"%s",optarg);
@ -1188,18 +1199,30 @@ int main(int argc, char **argv)
{ {
set_configdir(tmp_path); set_configdir(tmp_path);
} }
else
{
succp = false;
}
break; break;
case 'B': case 'B':
if(handle_path_arg(&tmp_path,optarg,NULL,true,false)) if(handle_path_arg(&tmp_path,optarg,NULL,true,false))
{ {
set_libdir(tmp_path); set_libdir(tmp_path);
} }
else
{
succp = false;
}
break; break;
case 'A': case 'A':
if(handle_path_arg(&tmp_path,optarg,NULL,true,true)) if(handle_path_arg(&tmp_path,optarg,NULL,true,true))
{ {
set_cachedir(tmp_path); set_cachedir(tmp_path);
} }
else
{
succp = false;
}
break; break;
case 'S': case 'S':
{ {

View File

@ -27,7 +27,7 @@
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";
static const char* default_piddir = "@MAXSCALE_VARDIR@/run/maxscale"; /*< This should be changed to just /run eventually, static const char* default_piddir = "@MAXSCALE_VARDIR@/run/maxscale"; /*< This should be changed to just /run eventually,
* the /var/run folder is an old standard and the newe FSH 3.0 * the /var/run folder is an old standard and the newer FSH 3.0
* uses /run for PID files.*/ * uses /run for PID files.*/
static const char* default_logdir = "@MAXSCALE_VARDIR@/log/maxscale"; static const char* default_logdir = "@MAXSCALE_VARDIR@/log/maxscale";
static const char* default_datadir = "@MAXSCALE_VARDIR@/lib/maxscale"; static const char* default_datadir = "@MAXSCALE_VARDIR@/lib/maxscale";