Debug weird startup bug

This commit is contained in:
Jonathan "Duke" Leto
2019-05-01 07:22:09 -07:00
parent 85ab0bf7c1
commit c60e3d97f1
2 changed files with 10 additions and 0 deletions

View File

@@ -1239,6 +1239,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
FILE* file = fopen(pathLockFile.string().c_str(), "a"); // empty lock file; created if it doesn't exist.
if (file) fclose(file);
fprintf(stderr,"Attempting to obtain lock %s\n", pathLockFile.string().c_str());
try {
static boost::interprocess::file_lock lock(pathLockFile.string().c_str());
if (!lock.try_lock())
@@ -1247,11 +1249,14 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. Komodo is probably already running.") + " %s.", strDataDir, e.what()));
}
fprintf(stderr,"About to create pidfile\n");
#ifndef _WIN32
CreatePidFile(GetPidFile(), getpid());
#endif
fprintf(stderr,"created pidfile\n");
if (GetBoolArg("-shrinkdebugfile", !fDebug))
ShrinkDebugFile();
fprintf(stderr,"past shrinkdebugfile\n");
LogPrintf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
LogPrintf("Komodo version %s (%s)\n", FormatFullVersion(), CLIENT_DATE);