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

@@ -750,8 +750,12 @@ void CreatePidFile(const boost::filesystem::path &path, pid_t pid)
FILE* file = fopen(path.string().c_str(), "w");
if (file)
{
fprintf(stderr,"Creating pid file %s\n", path.string().c_str());
fprintf(file, "%d\n", pid);
fclose(file);
} else {
fprintf(stderr,"Unable to make a pidfile %s !\n", path.string().c_str());
exit(1);
}
}
#endif
@@ -882,6 +886,7 @@ void AllocateFileRange(FILE *file, unsigned int offset, unsigned int length) {
void ShrinkDebugFile()
{
fprintf(stderr,"Shrinking %s\n", GetDataDir().c_str() );
// Scroll debug.log if it's getting too big
boost::filesystem::path pathLog = GetDataDir() / "debug.log";
FILE* file = fopen(pathLog.string().c_str(), "r");