mirror of
https://github.com/cygnusxi/CurecoinSource.git
synced 2025-07-27 15:44:25 +02:00
small fixes
This commit is contained in:
parent
a906f48b04
commit
53e7950962
12
src/util.cpp
12
src/util.cpp
@ -1113,6 +1113,7 @@ boost::filesystem::path GetPidFile()
|
||||
return pathPidFile;
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
void CreatePidFile(const boost::filesystem::path &path, util_pid_t pid)
|
||||
{
|
||||
FILE* file = fopen(path.string().c_str(), "w");
|
||||
@ -1122,6 +1123,17 @@ void CreatePidFile(const boost::filesystem::path &path, util_pid_t pid)
|
||||
fclose(file);
|
||||
}
|
||||
}
|
||||
#else
|
||||
void CreatePidFile(const boost::filesystem::path &path, pid_t pid)
|
||||
{
|
||||
FILE* file = fopen(path.string().c_str(), "w");
|
||||
if (file)
|
||||
{
|
||||
fprintf(file, "%d\n", pid);
|
||||
fclose(file);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest)
|
||||
{
|
||||
|
11
src/util.h
11
src/util.h
@ -7,6 +7,10 @@
|
||||
|
||||
#include "uint256.h"
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#ifndef WIN32
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
@ -15,9 +19,6 @@
|
||||
#include <processthreadsapi.h>
|
||||
typedef int util_pid_t; /* define for Windows compatibility */
|
||||
#endif
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include <boost/thread.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
@ -217,7 +218,11 @@ boost::filesystem::path GetDefaultDataDir();
|
||||
const boost::filesystem::path &GetDataDir(bool fNetSpecific = true);
|
||||
boost::filesystem::path GetConfigFile();
|
||||
boost::filesystem::path GetPidFile();
|
||||
#ifdef WIN32
|
||||
void CreatePidFile(const boost::filesystem::path &path, util_pid_t pid);
|
||||
#else
|
||||
void CreatePidFile(const boost::filesystem::path &path, pid_t pid);
|
||||
#endif
|
||||
void ReadConfigFile(std::map<std::string, std::string>& mapSettingsRet, std::map<std::string, std::vector<std::string> >& mapMultiSettingsRet);
|
||||
#ifdef WIN32
|
||||
boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate = true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user