From 561e375c73a37934fe77a519762d81edf7a3325c Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sat, 2 Feb 2019 00:40:36 +0200 Subject: Make PID file creating errors fatal --- src/util/system.cpp | 10 ---------- src/util/system.h | 1 - 2 files changed, 11 deletions(-) (limited to 'src/util') diff --git a/src/util/system.cpp b/src/util/system.cpp index 06317a3a90..8268456919 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -963,16 +963,6 @@ fs::path GetPidFile() { return AbsPathForConfigVal(fs::path(gArgs.GetArg("-pid", BITCOIN_PID_FILENAME))); } - -void CreatePidFile(const fs::path &path, pid_t pid) -{ - FILE* file = fsbridge::fopen(path, "w"); - if (file) - { - fprintf(file, "%d\n", pid); - fclose(file); - } -} #endif bool RenameOver(fs::path src, fs::path dest) diff --git a/src/util/system.h b/src/util/system.h index 5932e55793..44ba740e4e 100644 --- a/src/util/system.h +++ b/src/util/system.h @@ -86,7 +86,6 @@ void ClearDatadirCache(); fs::path GetConfigFile(const std::string& confPath); #ifndef WIN32 fs::path GetPidFile(); -void CreatePidFile(const fs::path &path, pid_t pid); #endif #ifdef WIN32 fs::path GetSpecialFolderPath(int nFolder, bool fCreate = true); -- cgit v1.2.3 From 3782075a5fd4ad0c15a6119e8cdaf136898f679e Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 14 Feb 2019 22:53:03 +0200 Subject: Move all PID file stuff to init.cpp It is only used from init.cpp. Move-only refactoring. --- src/util/system.cpp | 8 -------- src/util/system.h | 4 ---- 2 files changed, 12 deletions(-) (limited to 'src/util') diff --git a/src/util/system.cpp b/src/util/system.cpp index 8268456919..4934174420 100644 --- a/src/util/system.cpp +++ b/src/util/system.cpp @@ -79,7 +79,6 @@ const int64_t nStartupTime = GetTime(); const char * const BITCOIN_CONF_FILENAME = "bitcoin.conf"; -const char * const BITCOIN_PID_FILENAME = "bitcoind.pid"; ArgsManager gArgs; @@ -958,13 +957,6 @@ std::string ArgsManager::GetChainName() const return CBaseChainParams::MAIN; } -#ifndef WIN32 -fs::path GetPidFile() -{ - return AbsPathForConfigVal(fs::path(gArgs.GetArg("-pid", BITCOIN_PID_FILENAME))); -} -#endif - bool RenameOver(fs::path src, fs::path dest) { #ifdef WIN32 diff --git a/src/util/system.h b/src/util/system.h index 44ba740e4e..5dc796c9ba 100644 --- a/src/util/system.h +++ b/src/util/system.h @@ -39,7 +39,6 @@ int64_t GetStartupTime(); extern const char * const BITCOIN_CONF_FILENAME; -extern const char * const BITCOIN_PID_FILENAME; /** Translate a message to the native language of the user. */ const extern std::function G_TRANSLATION_FUN; @@ -84,9 +83,6 @@ const fs::path &GetBlocksDir(); const fs::path &GetDataDir(bool fNetSpecific = true); void ClearDatadirCache(); fs::path GetConfigFile(const std::string& confPath); -#ifndef WIN32 -fs::path GetPidFile(); -#endif #ifdef WIN32 fs::path GetSpecialFolderPath(int nFolder, bool fCreate = true); #endif -- cgit v1.2.3