diff --git a/src/init.cpp b/src/init.cpp index 88a0acf29..abd176c96 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1924,6 +1924,12 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) "Please add txindex=1 to your configuration and start with -reindex"); } + #if !defined(__linux) + if (fZelnode) { + return InitError("Zelnode can be run only on Linux"); + } + #endif + if (fZelnode) { LogPrintf("IS FLUXNODE\n"); strZelnodeAddr = GetArg("-zelnodeaddr", ""); diff --git a/src/zelnode/benchmarks.cpp b/src/zelnode/benchmarks.cpp index a0bbcafb6..4d230cf31 100644 --- a/src/zelnode/benchmarks.cpp +++ b/src/zelnode/benchmarks.cpp @@ -4,19 +4,21 @@ #include #include -#include "benchmarks.h" #include #include #include #include - -#include // dirname -#include // readlink -#include // PATH_MAX +#include #include "zelnode/zelnode.h" +#include "benchmarks.h" + +#if defined(__linux) +# include // dirname +# include // readlink +# include // PATH_MAX +#endif -#include namespace filesys = boost::filesystem; @@ -33,17 +35,21 @@ std::string strTestnetSring = "-testnet "; std::string GetSelfPath() { - char result[ PATH_MAX ]; - ssize_t count = readlink( "/proc/self/exe", result, PATH_MAX ); + #if defined(__linux) + char result[ PATH_MAX ]; + ssize_t count = readlink( "/proc/self/exe", result, PATH_MAX ); - const char *path; + const char *path; - if (count != -1) { - path = dirname(result); - return std::string(path); - } + if (count != -1) { + path = dirname(result); + return std::string(path); + } + + return ""; + #endif - return ""; + return ""; } bool FindBenchmarkPath(std::string filename, std::string file_path ) @@ -253,6 +259,3 @@ bool GetBenchmarkSignedTransaction(const CTransaction& tx, CTransaction& signedT error = "Benchd isn't running"; return false; } - - -