Call uv_loop_fork to redecorate the default loop after fork()

This commit is contained in:
Tony Butler 2024-06-03 12:45:37 -06:00
parent 5eaa6c152e
commit 3a46a28af0
2 changed files with 5 additions and 2 deletions

View file

@ -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;

View file

@ -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) {