From 429039d45d1af9cfda9e706d4ac8f1a144ed66d4 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 23 May 2012 23:10:59 -0400 Subject: [PATCH] Refactor: move runCommand() to util.cpp --- src/main.cpp | 8 -------- src/util.cpp | 8 ++++++++ src/util.h | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 9a4d7abc8..9e20ca626 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1501,14 +1501,6 @@ bool static Reorganize(CTxDB& txdb, CBlockIndex* pindexNew) } -static void -runCommand(std::string strCommand) -{ - int nErr = ::system(strCommand.c_str()); - if (nErr) - printf("runCommand error: system(%s) returned %d\n", strCommand.c_str(), nErr); -} - // Called from inside SetBestChain: attaches a block to the new best chain being built bool CBlock::SetBestChainInner(CTxDB& txdb, CBlockIndex *pindexNew) { diff --git a/src/util.cpp b/src/util.cpp index 08e3625b3..3ab30baff 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1079,3 +1079,11 @@ boost::filesystem::path GetSpecialFolderPath(int nFolder, bool fCreate) return fs::path(""); } #endif + +void runCommand(std::string strCommand) +{ + int nErr = ::system(strCommand.c_str()); + if (nErr) + printf("runCommand error: system(%s) returned %d\n", strCommand.c_str(), nErr); +} + diff --git a/src/util.h b/src/util.h index 5b58147ce..c1c91bdbc 100644 --- a/src/util.h +++ b/src/util.h @@ -171,6 +171,7 @@ int64 GetAdjustedTime(); std::string FormatFullVersion(); std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector& comments); void AddTimeData(const CNetAddr& ip, int64 nTime); +void runCommand(std::string strCommand);