static char *name = NULL;
static char *identname = NULL; /* program name for syslog */
static char *pidfilename = NULL; /* pid file location */
+static char *confdir = NULL;
static char controlcookie[1024];
char *netname = NULL;
char *confbase = NULL;
if(!*installdir) {
#endif
+ confdir = xstrdup(CONFDIR);
if(!pidfilename)
xasprintf(&pidfilename, "%s/run/%s.pid", LOCALSTATEDIR, identname);
}
#ifdef HAVE_MINGW
- }
+ } else
+ confdir = xstrdup(installdir);
#endif
xasprintf(&tinc_conf, "%s/tinc.conf", confbase);
return 1;
}
- if(mkdir(CONFDIR, 0755) && errno != EEXIST) {
+ if(mkdir(confdir, 0755) && errno != EEXIST) {
fprintf(stderr, "Could not create directory %s: %s\n", CONFDIR, strerror(errno));
return 1;
}