From a7be8cb80c0b08c6bd91bd660be39be2cc8d0704 Mon Sep 17 00:00:00 2001 From: XMRig Date: Wed, 5 Jun 2024 03:45:37 +0700 Subject: [PATCH] Remove chdir call after fork. --- src/App.cpp | 5 ++--- src/App_unix.cpp | 14 +++----------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/App.cpp b/src/App.cpp index 100d24833..3437525af 100644 --- a/src/App.cpp +++ b/src/App.cpp @@ -6,8 +6,8 @@ * Copyright 2016 Jay D Dee * Copyright 2017-2018 XMR-Stak , * Copyright 2018 Lee Clagett - * Copyright 2018-2020 SChernykh - * Copyright 2016-2020 XMRig , + * Copyright 2018-2024 SChernykh + * Copyright 2016-2024 XMRig , * * 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 @@ -23,7 +23,6 @@ * along with this program. If not, see . */ - #include #include diff --git a/src/App_unix.cpp b/src/App_unix.cpp index b0b800792..2cd400943 100644 --- a/src/App_unix.cpp +++ b/src/App_unix.cpp @@ -5,8 +5,8 @@ * Copyright 2014-2016 Wolf9466 * Copyright 2016 Jay D Dee * Copyright 2017-2018 XMR-Stak , - * Copyright 2018-2020 SChernykh - * Copyright 2016-2020 XMRig , + * Copyright 2018-2024 SChernykh + * Copyright 2016-2024 XMRig , * * 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 @@ -22,7 +22,6 @@ * along with this program. If not, see . */ - #include #include #include @@ -53,16 +52,9 @@ bool xmrig::App::background(int &rc) return true; } - i = setsid(); - - if (i < 0) { + if (setsid() < 0) { LOG_ERR("setsid() failed (errno = %d)", errno); } - i = chdir("/"); - if (i < 0) { - LOG_ERR("chdir() failed (errno = %d)", errno); - } - return false; }