#1183 Disable stdin handler if not available.
This commit is contained in:
parent
7a1ff6bfed
commit
e57798360f
5 changed files with 100 additions and 14 deletions
|
@ -26,9 +26,11 @@
|
|||
#define XMRIG_CONSOLE_H
|
||||
|
||||
|
||||
#include <uv.h>
|
||||
#include "base/tools/Object.h"
|
||||
|
||||
|
||||
#include <uv.h>
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
@ -39,18 +41,22 @@ class IConsoleListener;
|
|||
class Console
|
||||
{
|
||||
public:
|
||||
XMRIG_DISABLE_COPY_MOVE_DEFAULT(Console)
|
||||
|
||||
Console(IConsoleListener *listener);
|
||||
~Console();
|
||||
|
||||
void stop();
|
||||
|
||||
private:
|
||||
bool isSupported() const;
|
||||
|
||||
static void onAllocBuffer(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf);
|
||||
static void onRead(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf);
|
||||
|
||||
char m_buf[1];
|
||||
char m_buf[1] = { 0 };
|
||||
IConsoleListener *m_listener;
|
||||
uv_tty_t *m_tty;
|
||||
uv_tty_t *m_tty = nullptr;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue