Chdir() to the configuration directory instead of /.
[tinc] / src / process.c
index cbc816b..5d78c29 100644 (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;
                }