mirror of
https://github.com/cygnusxi/CurecoinSource.git
synced 2025-07-27 23:54:22 +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;
|
return pathPidFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
void CreatePidFile(const boost::filesystem::path &path, util_pid_t pid)
|
void CreatePidFile(const boost::filesystem::path &path, util_pid_t pid)
|
||||||
{
|
{
|
||||||
FILE* file = fopen(path.string().c_str(), "w");
|
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);
|
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)
|
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 "uint256.h"
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
@ -15,9 +19,6 @@
|
|||||||
#include <processthreadsapi.h>
|
#include <processthreadsapi.h>
|
||||||
typedef int util_pid_t; /* define for Windows compatibility */
|
typedef int util_pid_t; /* define for Windows compatibility */
|
||||||
#endif
|
#endif
|
||||||
#include <map>
|
|
||||||
#include <vector>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include <boost/thread.hpp>
|
#include <boost/thread.hpp>
|
||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
@ -217,7 +218,11 @@ boost::filesystem::path GetDefaultDataDir();
|
|||||||
const boost::filesystem::path &GetDataDir(bool fNetSpecific = true);
|
const boost::filesystem::path &GetDataDir(bool fNetSpecific = true);
|
||||||
boost::filesystem::path GetConfigFile();
|
boost::filesystem::path GetConfigFile();
|
||||||
boost::filesystem::path GetPidFile();
|
boost::filesystem::path GetPidFile();
|
||||||
|
#ifdef WIN32
|
||||||
void CreatePidFile(const boost::filesystem::path &path, util_pid_t pid);
|
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);
|
void ReadConfigFile(std::map<std::string, std::string>& mapSettingsRet, std::map<std::string, std::vector<std::string> >& mapMultiSettingsRet);
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate = true);
|
boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate = true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user