fix xmrig bundling issues
This commit is contained in:
@@ -466,6 +466,18 @@ bool XmrigManager::startProcess(const std::string& xmrigPath, const std::string&
|
||||
dup2(pipefd[1], STDERR_FILENO);
|
||||
close(pipefd[1]);
|
||||
|
||||
// Detach from controlling terminal's stdin to prevent SIGTTIN/SIGTTOU
|
||||
// when running in a new process group (setpgid below).
|
||||
int devnull = open("/dev/null", O_RDONLY);
|
||||
if (devnull >= 0) {
|
||||
dup2(devnull, STDIN_FILENO);
|
||||
close(devnull);
|
||||
}
|
||||
|
||||
// Ignore job-control signals that a background process group may receive
|
||||
signal(SIGTTIN, SIG_IGN);
|
||||
signal(SIGTTOU, SIG_IGN);
|
||||
|
||||
// New process group so we can kill the whole group
|
||||
setpgid(0, 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user