Call uv_loop_fork
to redecorate the default loop after fork()
This commit is contained in:
parent
5eaa6c152e
commit
3a46a28af0
2 changed files with 5 additions and 2 deletions
|
@ -61,13 +61,13 @@ int xmrig::App::exec()
|
|||
return 2;
|
||||
}
|
||||
|
||||
m_signals = std::make_shared<Signals>(this);
|
||||
|
||||
int rc = 0;
|
||||
if (background(rc)) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
m_signals = std::make_shared<Signals>(this);
|
||||
|
||||
rc = m_controller->init();
|
||||
if (rc != 0) {
|
||||
return rc;
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <csignal>
|
||||
#include <cerrno>
|
||||
#include <unistd.h>
|
||||
#include <uv.h>
|
||||
|
||||
|
||||
#include "App.h"
|
||||
|
@ -53,6 +54,8 @@ bool xmrig::App::background(int &rc)
|
|||
return true;
|
||||
}
|
||||
|
||||
uv_loop_fork(uv_default_loop());
|
||||
|
||||
i = setsid();
|
||||
|
||||
if (i < 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue