Merge pull request #2855 from Diapolo/guard_CreatePidFile

exclude CreatePidFile() function on WIN32 as it is unused
This commit is contained in:
Gavin Andresen 2013-08-05 01:05:59 -07:00
commit e622f3f195
3 changed files with 5 additions and 1 deletions

View File

@ -74,7 +74,7 @@ bool AppInit(int argc, char* argv[])
int ret = CommandLineRPC(argc, argv); int ret = CommandLineRPC(argc, argv);
exit(ret); exit(ret);
} }
#if !defined(WIN32) #ifndef WIN32
fDaemon = GetBoolArg("-daemon", false); fDaemon = GetBoolArg("-daemon", false);
if (fDaemon) if (fDaemon)
{ {

View File

@ -1118,6 +1118,7 @@ boost::filesystem::path GetPidFile()
return pathPidFile; return pathPidFile;
} }
#ifndef WIN32
void CreatePidFile(const boost::filesystem::path &path, pid_t pid) void CreatePidFile(const boost::filesystem::path &path, pid_t pid)
{ {
FILE* file = fopen(path.string().c_str(), "w"); FILE* file = fopen(path.string().c_str(), "w");
@ -1127,6 +1128,7 @@ void CreatePidFile(const boost::filesystem::path &path, pid_t pid)
fclose(file); fclose(file);
} }
} }
#endif
bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest) bool RenameOver(boost::filesystem::path src, boost::filesystem::path dest)
{ {

View File

@ -207,7 +207,9 @@ 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();
#ifndef WIN32
void CreatePidFile(const boost::filesystem::path &path, pid_t pid); 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);