Added real graceful exit.

This commit is contained in:
XMRig 2019-03-16 00:44:15 +07:00
parent 1e62943010
commit ba68fb6c53
41 changed files with 391 additions and 303 deletions

View file

@ -5,7 +5,8 @@
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2016-2018 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -21,8 +22,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __CONSOLELOG_H__
#define __CONSOLELOG_H__
#ifndef XMRIG_CONSOLELOG_H
#define XMRIG_CONSOLELOG_H
#include <uv.h>
@ -32,15 +33,15 @@
namespace xmrig {
class Controller;
}
class ConsoleLog : public ILogBackend
{
public:
ConsoleLog(xmrig::Controller *controller);
ConsoleLog();
~ConsoleLog() override;
protected:
void message(Level level, const char *fmt, va_list args) override;
void text(const char *fmt, va_list args) override;
@ -52,8 +53,11 @@ private:
char m_fmt[256];
uv_buf_t m_uvBuf;
uv_stream_t *m_stream;
uv_tty_t m_tty;
xmrig::Controller *m_controller;
uv_tty_t *m_tty;
};
#endif /* __CONSOLELOG_H__ */
} /* namespace xmrig */
#endif /* XMRIG_CONSOLELOG_H */