Merge branch 'patch-1' of https://github.com/jsonboss/xmrig into jsonboss-patch-1

This commit is contained in:
XMRig 2021-04-24 22:14:59 +07:00
commit 259c165e60
No known key found for this signature in database
GPG key ID: 446A53638BE94409

View file

@ -57,7 +57,12 @@ public:
xmrig::Msr::Msr() : d_ptr(new MsrPrivate())
{
if (system("/sbin/modprobe msr allow_writes=on > /dev/null 2>&1") != 0) {
if(access("/sys/module/msr/parameters/allow_writes", F_OK) == 0) {
if(system("echo on > /sys/module/msr/parameters/allow_writes") != 0) {
d_ptr->available = false;
}
}
else if (system("/sbin/modprobe msr allow_writes=on > /dev/null 2>&1") != 0) {
LOG_WARN("%s " YELLOW_BOLD("msr kernel module is not available"), Msr::tag());
d_ptr->available = false;