mirror of
https://github.com/xmrig/xmrig.git
synced 2026-04-30 09:12:39 -04:00
Call uv_loop_fork to redecorate the default loop after fork()
This commit is contained in:
@@ -61,13 +61,13 @@ int xmrig::App::exec()
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_signals = std::make_shared<Signals>(this);
|
|
||||||
|
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
if (background(rc)) {
|
if (background(rc)) {
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_signals = std::make_shared<Signals>(this);
|
||||||
|
|
||||||
rc = m_controller->init();
|
rc = m_controller->init();
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
return rc;
|
return rc;
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
#include <csignal>
|
#include <csignal>
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <uv.h>
|
||||||
|
|
||||||
|
|
||||||
#include "App.h"
|
#include "App.h"
|
||||||
@@ -53,6 +54,8 @@ bool xmrig::App::background(int &rc)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uv_loop_fork(uv_default_loop());
|
||||||
|
|
||||||
i = setsid();
|
i = setsid();
|
||||||
|
|
||||||
if (i < 0) {
|
if (i < 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user