Fix online reconfiguration: Test rundir usability in the correct place.

It was tested in reconfiguration, using a null pointer.
This commit is contained in:
Heikki Hannikainen 2014-03-04 22:02:46 +02:00
parent f20f5ca656
commit 149cf2bb5b
1 changed files with 7 additions and 5 deletions

View File

@ -1243,6 +1243,7 @@ int read_config(void)
* for the first time.
*/
if (!rundir) {
/* initial setup */
if (new_rundir) {
rundir = new_rundir;
new_rundir = NULL;
@ -1250,16 +1251,17 @@ int read_config(void)
hlog(LOG_CRIT, "Config: rundir not defined.");
failed = 1;
}
if (test_directory(rundir)) {
hlog(LOG_CRIT, "Config: rundir %s is not a directory.", rundir);
failed = 1;
}
} else {
/* reconfig */
if (new_rundir) {
hfree(new_rundir);
new_rundir = NULL;
}
if (test_directory(new_rundir)) {
hlog(LOG_CRIT, "Config: rundir %s is not a directory.", new_rundir);
failed = 1;
}
}
if (!log_dir) {