|
|
@ -760,8 +760,8 @@ string GetPidFile()
|
|
|
|
|
|
|
|
|
|
|
|
void CreatePidFile(string pidFile, pid_t pid)
|
|
|
|
void CreatePidFile(string pidFile, pid_t pid)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
FILE* file;
|
|
|
|
FILE* file = fopen(pidFile.c_str(), "w");
|
|
|
|
if (file = fopen(pidFile.c_str(), "w"))
|
|
|
|
if (file)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fprintf(file, "%d\n", pid);
|
|
|
|
fprintf(file, "%d\n", pid);
|
|
|
|
fclose(file);
|
|
|
|
fclose(file);
|
|
|
@ -790,7 +790,9 @@ void ShrinkDebugFile()
|
|
|
|
fseek(file, -sizeof(pch), SEEK_END);
|
|
|
|
fseek(file, -sizeof(pch), SEEK_END);
|
|
|
|
int nBytes = fread(pch, 1, sizeof(pch), file);
|
|
|
|
int nBytes = fread(pch, 1, sizeof(pch), file);
|
|
|
|
fclose(file);
|
|
|
|
fclose(file);
|
|
|
|
if (file = fopen(strFile.c_str(), "w"))
|
|
|
|
|
|
|
|
|
|
|
|
file = fopen(strFile.c_str(), "w");
|
|
|
|
|
|
|
|
if (file)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fwrite(pch, 1, nBytes, file);
|
|
|
|
fwrite(pch, 1, nBytes, file);
|
|
|
|
fclose(file);
|
|
|
|
fclose(file);
|
|
|
|