Skip to content

Commit

Permalink
Merge pull request #142 from zelcash/cross_compile
Browse files Browse the repository at this point in the history
fluxnode Linux specific
  • Loading branch information
TheTrunk committed May 4, 2021
2 parents 10e684e + c613aac commit 2d760ac
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
6 changes: 6 additions & 0 deletions src/init.cpp
Expand Up @@ -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", "");
Expand Down
37 changes: 20 additions & 17 deletions src/zelnode/benchmarks.cpp
Expand Up @@ -4,19 +4,21 @@

#include <util.h>
#include <utiltime.h>
#include "benchmarks.h"
#include <regex>
#include <univalue/include/univalue.h>
#include <rpc/protocol.h>
#include <core_io.h>

#include <libgen.h> // dirname
#include <unistd.h> // readlink
#include <linux/limits.h> // PATH_MAX
#include <boost/filesystem.hpp>

#include "zelnode/zelnode.h"
#include "benchmarks.h"

#if defined(__linux)
# include <libgen.h> // dirname
# include <unistd.h> // readlink
# include <linux/limits.h> // PATH_MAX
#endif

#include <boost/filesystem.hpp>

namespace filesys = boost::filesystem;

Expand All @@ -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 )
Expand Down Expand Up @@ -253,6 +259,3 @@ bool GetBenchmarkSignedTransaction(const CTransaction& tx, CTransaction& signedT
error = "Benchd isn't running";
return false;
}



0 comments on commit 2d760ac

Please sign in to comment.