Made executable names of miner and daemon settable via CMake parameters.
This commit is contained in:
parent
26a260b21e
commit
12fa14f034
3 changed files with 14 additions and 3 deletions
|
@ -36,16 +36,22 @@
|
|||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
#ifndef MINER_EXECUTABLE_NAME
|
||||
#define MINER_EXECUTABLE_NAME xmrigMiner
|
||||
#endif
|
||||
#define VALUE_TO_STRING(x) #x
|
||||
#define VALUE(x) VALUE_TO_STRING(x)
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
std::string ownPath(argv[0]);
|
||||
|
||||
#if defined(_WIN32) || defined(WIN32)
|
||||
int pos = ownPath.rfind('\\');
|
||||
std::string xmrigMiner("xmrigMiner.exe");
|
||||
std::string xmrigMiner( VALUE(MINER_EXECUTABLE_NAME) ".exe");
|
||||
#else
|
||||
int pos = ownPath.rfind('/');
|
||||
std::string xmrigMiner("xmrigMiner");
|
||||
std::string xmrigMiner( VALUE(MINER_EXECUTABLE_NAME) );
|
||||
#endif
|
||||
|
||||
std::string xmrigMinerPath = ownPath.substr(0, pos+1) + xmrigMiner;
|
||||
|
|
|
@ -282,7 +282,7 @@ void Client::onRead(net_t *net, size_t size, char *buf)
|
|||
{
|
||||
auto client = getClient(net->data);
|
||||
|
||||
if (size < 0) {
|
||||
if (size == 0) {
|
||||
if (size != UV_EOF && !client->m_quiet) {
|
||||
LOG_ERR("[%s:%u] read error: \"%s\"", client->m_url.host(), client->m_url.port(), uv_strerror((int) size));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue