Chdir() to the configuration directory instead of /.

This commit is contained in:
Guus Sliepen 2016-04-17 14:04:57 +02:00
parent 9bd978cc8e
commit af9ee7ff00
2 changed files with 2 additions and 1 deletions

View file

@ -203,7 +203,7 @@ bool detach(void) {
if(do_detach) {
#ifndef HAVE_MINGW
if(daemon(0, 0)) {
if(daemon(1, 0)) {
logger(DEBUG_ALWAYS, LOG_ERR, "Couldn't detach from terminal: %s", strerror(errno));
return false;
}

View file

@ -338,6 +338,7 @@ int main(int argc, char **argv) {
return 1;
make_names(true);
chdir(confbase);
if(show_version) {
printf("%s version %s (built %s %s, protocol %d.%d)\n", PACKAGE,