diff options
author | Chris Robinson <[email protected]> | 2022-05-09 12:38:12 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-05-09 12:38:12 -0700 |
commit | c870e550fa37d10e8a9d7d15ef1d6370d1e0399e (patch) | |
tree | da7489113d46f666e35f38078511c3ee8a66b592 /core/helpers.cpp | |
parent | 5c55ec2f9bd972510454a04ccb40238f4cd0219c (diff) |
Don't enable RTKit/D-Bus support on Windows
Diffstat (limited to 'core/helpers.cpp')
-rw-r--r-- | core/helpers.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/core/helpers.cpp b/core/helpers.cpp index e4a94fe5..c7e45a8b 100644 --- a/core/helpers.cpp +++ b/core/helpers.cpp @@ -461,6 +461,17 @@ bool SetRTPriorityRTKit(int prio) /* Don't stupidly exit if the connection dies while doing this. */ dbus_connection_set_exit_on_disconnect(conn.get(), false); + int nicemin{}; + int err{rtkit_get_min_nice_level(conn.get(), &nicemin)}; + if(err == -ENOENT) + { + err = std::abs(err); + ERR("Could not query RTKit: %s (%d)\n", std::strerror(err), err); + return false; + } + int rtmax{rtkit_get_max_realtime_priority(conn.get())}; + TRACE("Maximum real-time priority: %d, minimum niceness: %d\n", rtmax, nicemin); + auto limit_rttime = [](DBusConnection *c) -> int { using ulonglong = unsigned long long; @@ -483,18 +494,6 @@ bool SetRTPriorityRTKit(int prio) } return 0; }; - - int nicemin{}; - int err{rtkit_get_min_nice_level(conn.get(), &nicemin)}; - if(err == -ENOENT) - { - err = std::abs(err); - ERR("Could not query RTKit: %s (%d)\n", std::strerror(err), err); - return false; - } - int rtmax{rtkit_get_max_realtime_priority(conn.get())}; - TRACE("Maximum real-time priority: %d, minimum niceness: %d\n", rtmax, nicemin); - if(rtmax > 0) { if(AllowRTTimeLimit) |