else
xasprintf(&confbase, "%s", installdir);
}
- if(!pidfilename)
- xasprintf(&pidfilename, "%s" SLASH "pid", confbase);
}
RegCloseKey(key);
}
if(!confdir)
confdir = xstrdup(CONFDIR SLASH "tinc");
+ if(!confbase) {
+ if(netname)
+ xasprintf(&confbase, CONFDIR SLASH "tinc" SLASH "%s", netname);
+ else
+ xasprintf(&confbase, CONFDIR SLASH "tinc");
+ }
+
+#ifdef HAVE_MINGW
+ if(!logfilename)
+ xasprintf(&logfilename, "%s" SLASH "log", confbase);
+
+ if(!pidfilename)
+ xasprintf(&pidfilename, "%s" SLASH "pid", confbase);
+#else
if(!logfilename)
xasprintf(&logfilename, LOCALSTATEDIR SLASH "log" SLASH "%s.log", identname);
if(!pidfilename)
xasprintf(&pidfilename, LOCALSTATEDIR SLASH "run" SLASH "%s.pid", identname);
+#endif
if(!unixsocketname) {
int len = strlen(pidfilename);
else
strcpy(unixsocketname + len, ".socket");
}
-
- if(!confbase) {
- if(netname)
- xasprintf(&confbase, CONFDIR SLASH "tinc" SLASH "%s", netname);
- else
- xasprintf(&confbase, CONFDIR SLASH "tinc");
- }
}
void free_names(void) {