/*
names.c -- generate commonly used (file)names
Copyright (C) 1998-2005 Ivo Timmermans
- 2000-2017 Guus Sliepen <guus@tinc-vpn.org>
+ 2000-2018 Guus Sliepen <guus@tinc-vpn.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Set all files and paths according to netname
*/
void make_names(bool daemon) {
-#ifdef HAVE_MINGW
+#ifdef HAVE_WINDOWS
HKEY key;
char installdir[1024] = "";
DWORD len = sizeof(installdir);
logger(DEBUG_ALWAYS, LOG_INFO, "Both netname and configuration directory given, using the latter...");
}
+ free(identname);
+
if(netname) {
xasprintf(&identname, "tinc.%s", netname);
} else {
identname = xstrdup("tinc");
}
-#ifdef HAVE_MINGW
+#ifdef HAVE_WINDOWS
if(!RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\tinc", 0, KEY_READ, &key)) {
if(!RegQueryValueEx(key, NULL, 0, 0, (LPBYTE)installdir, &len)) {
}
}
-#ifdef HAVE_MINGW
+#ifdef HAVE_WINDOWS
+ (void)daemon;
if(!logfilename) {
xasprintf(&logfilename, "%s" SLASH "log", confbase);
#endif
if(!unixsocketname) {
- int len = strlen(pidfilename);
+ size_t len = strlen(pidfilename);
unixsocketname = xmalloc(len + 8);
memcpy(unixsocketname, pidfilename, len);