Fix --logfile without a filename on Windows.
On Windows, the log filename now defaults to "tinc.log" in the same directory as tinc.conf. # Conflicts: # src/tincd.c
This commit is contained in:
parent
c544e5e8fe
commit
0e8e53b4ce
1 changed files with 2 additions and 2 deletions
|
|
@ -57,14 +57,14 @@ void make_names(bool daemon) {
|
||||||
if(!RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\tinc", 0, KEY_READ, &key)) {
|
if(!RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\tinc", 0, KEY_READ, &key)) {
|
||||||
if(!RegQueryValueEx(key, NULL, 0, 0, (LPBYTE)installdir, &len)) {
|
if(!RegQueryValueEx(key, NULL, 0, 0, (LPBYTE)installdir, &len)) {
|
||||||
confdir = xstrdup(installdir);
|
confdir = xstrdup(installdir);
|
||||||
if(!logfilename)
|
|
||||||
xasprintf(&logfilename, "%s" SLASH "log" SLASH "%s.log", installdir, identname);
|
|
||||||
if(!confbase) {
|
if(!confbase) {
|
||||||
if(netname)
|
if(netname)
|
||||||
xasprintf(&confbase, "%s" SLASH "%s", installdir, netname);
|
xasprintf(&confbase, "%s" SLASH "%s", installdir, netname);
|
||||||
else
|
else
|
||||||
xasprintf(&confbase, "%s", installdir);
|
xasprintf(&confbase, "%s", installdir);
|
||||||
}
|
}
|
||||||
|
if(!logfilename)
|
||||||
|
xasprintf(&logfilename, "%s" SLASH "tinc.log", confbase);
|
||||||
}
|
}
|
||||||
RegCloseKey(key);
|
RegCloseKey(key);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue