Skip to content
This repository was archived by the owner on Apr 24, 2022. It is now read-only.

Commit 68fc436

Browse files
jean-m-cyrXhmikosR
authored andcommittedJun 20, 2018
Fix DBUS build
1 parent 2810cee commit 68fc436

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed
 

‎ethminer/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if(ETHDBUS)
2121
pkg_check_modules(DBUS dbus-1)
2222
include_directories(${DBUS_INCLUDE_DIRS})
2323
link_directories(${DBUS_LIBRARY_DIRS})
24-
target_link_libraries(${EXECUTABLE} ${DBUS_LIBRARIES})
24+
target_link_libraries(ethminer PRIVATE ${DBUS_LIBRARIES})
2525
endif()
2626

2727
if(APICORE)

‎ethminer/DBusInt.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ class DBusInt
1313
conn = dbus_bus_get(DBUS_BUS_SESSION, &err);
1414
if (!conn)
1515
{
16-
cerr << "DBus error " << err.name << ": " << err.message << endl;
16+
minelog << "DBus error " << err.name << ": " << err.message;
1717
}
1818
dbus_bus_request_name(conn, "eth.miner", DBUS_NAME_FLAG_REPLACE_EXISTING, &err);
1919
if (dbus_error_is_set(&err))
2020
{
21-
cerr << "DBus error " << err.name << ": " << err.message << endl;
21+
minelog << "DBus error " << err.name << ": " << err.message;
2222
dbus_connection_close(conn);
2323
}
24-
cout << "DBus initialized!" << endl;
24+
minelog << "DBus initialized!";
2525
}
2626

2727
void send(const char *hash)
@@ -30,10 +30,10 @@ class DBusInt
3030
msg = dbus_message_new_signal("/eth/miner/hash", "eth.miner.monitor", "Hash");
3131
if (msg == nullptr)
3232
{
33-
cerr << "Message is null!" << endl;
33+
minelog << "Message is null!";
3434
}
3535
dbus_message_append_args(msg, DBUS_TYPE_STRING, &hash, DBUS_TYPE_INVALID);
36-
if (!dbus_connection_send(conn, msg, nullptr)) cerr << "Error sending message!" << endl;
36+
if (!dbus_connection_send(conn, msg, nullptr)) cerr << "Error sending message!";
3737
dbus_message_unref(msg);
3838
}
3939

‎ethminer/main.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@
3535
#include <libpoolprotocols/getwork/EthGetworkClient.h>
3636
#include <libpoolprotocols/testing/SimulateClient.h>
3737

38-
#if ETH_DBUS
39-
#include <DBusInt.h>
40-
#endif
41-
4238
#if API_CORE
4339
#include <libapicore/ApiServer.h>
4440
#include <libapicore/httpServer.h>
@@ -56,6 +52,10 @@ struct MiningChannel: public LogChannel
5652

5753
#define minelog clog(MiningChannel)
5854

55+
#if ETH_DBUS
56+
#include <ethminer/DBusInt.h>
57+
#endif
58+
5959
bool g_running = false;
6060

6161
class MinerCLI
@@ -758,7 +758,7 @@ class MinerCLI
758758
minelog << mp << ' ' << f.getSolutionStats() << ' ' << f.farmLaunchedFormatted();
759759

760760
#if ETH_DBUS
761-
dbusint.send(toString(mp).data());
761+
dbusint.send(toString(mp).c_str());
762762
#endif
763763
}
764764
else {

0 commit comments

Comments
 (0)
This repository has been archived.