From: Guus Sliepen Date: Sun, 17 Apr 2016 12:04:57 +0000 (+0200) Subject: Chdir() to the configuration directory instead of /. X-Git-Tag: release-1.1pre12~13 X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=af9ee7ff003fb448b783ccf39347907adc239cb2;p=tinc Chdir() to the configuration directory instead of /. --- 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,