- return true;
-}
-
-/*
- Set all files and paths according to netname
-*/
-static void make_names(void) {
-#ifdef HAVE_MINGW
- HKEY key;
- char installdir[1024] = "";
- long len = sizeof installdir;
-#endif
-
- if(netname)
- xasprintf(&identname, "tinc.%s", netname);
- else
- identname = xstrdup("tinc");
-
-#ifdef HAVE_MINGW
- if(!RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\tinc", 0, KEY_READ, &key)) {
- if(!RegQueryValueEx(key, NULL, 0, 0, installdir, &len)) {
- if(!logfilename)
- xasprintf(&logfilename, "%s/log/%s.log", identname);
- if(!confbase) {
- if(netname)
- xasprintf(&confbase, "%s/%s", installdir, netname);
- else
- xasprintf(&confbase, "%s", installdir);
- }
- if(!pidfilename)
- xasprintf(&pidfilename, "%s/pid", confbase);
- }
- RegCloseKey(key);
- if(*installdir)
- return;
- }
-#endif
-
- if(!logfilename)
- xasprintf(&logfilename, LOCALSTATEDIR "/log/%s.log", identname);
-
- if(!pidfilename)
- xasprintf(&pidfilename, LOCALSTATEDIR "/run/%s.pid", identname);
-
- if(netname) {
- if(!confbase)
- xasprintf(&confbase, CONFDIR "/tinc/%s", netname);
- else
- logger(DEBUG_ALWAYS, LOG_INFO, "Both netname and configuration directory given, using the latter...");
- } else {
- if(!confbase)
- xasprintf(&confbase, CONFDIR "/tinc");