From af9ee7ff003fb448b783ccf39347907adc239cb2 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sun, 17 Apr 2016 14:04:57 +0200 Subject: [PATCH] Chdir() to the configuration directory instead of /. --- src/process.c | 2 +- src/tincd.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/process.c b/src/process.c index cbc816be..5d78c295 100644 --- a/src/process.c +++ b/src/process.c @@ -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; } diff --git a/src/tincd.c b/src/tincd.c index 15a5622d..3bc17e23 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -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, -- 2.20.1