From: Guus Sliepen Date: Tue, 14 Apr 2015 09:20:24 +0000 (+0200) Subject: Fix --logfile without a filename on Windows. X-Git-Tag: release-1.1pre12~50 X-Git-Url: https://tinc-vpn.org/git/browse?a=commitdiff_plain;h=0e8e53b4cee8f1ea27bad501cbc18292ced54fa1;p=tinc 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 --- diff --git a/src/names.c b/src/names.c index 2782dd36..47729dac 100644 --- a/src/names.c +++ b/src/names.c @@ -57,14 +57,14 @@ void make_names(bool daemon) { if(!RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\tinc", 0, KEY_READ, &key)) { if(!RegQueryValueEx(key, NULL, 0, 0, (LPBYTE)installdir, &len)) { confdir = xstrdup(installdir); - if(!logfilename) - xasprintf(&logfilename, "%s" SLASH "log" SLASH "%s.log", installdir, identname); if(!confbase) { if(netname) xasprintf(&confbase, "%s" SLASH "%s", installdir, netname); else xasprintf(&confbase, "%s", installdir); } + if(!logfilename) + xasprintf(&logfilename, "%s" SLASH "tinc.log", confbase); } RegCloseKey(key); }