Skip to content

Commit

Permalink
Fix the RealtimeKit dbus include guards
Browse files Browse the repository at this point in the history
The SDL_USE_LIBDBUS define is set inside SDL_debug.h, therefore the
circular dependency made it impossible for this feature to be enabled.

Instead, guard SDL_dbus.h based on the autoconf variable HAVE_DBUS_DBUS_H

Additionally, fix one of the rtkit comments. CAP_SYS_NICE isn't required
to achieve high priority. But there is some scheduler config that rtkit
needs the app to setup.
  • Loading branch information
slouken committed Sep 27, 2019
1 parent 4001e6b commit 84dc44e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Empty file modified Xcode/SDL/SDL.xcodeproj/project.pbxproj 100644 → 100755
Empty file.
19 changes: 10 additions & 9 deletions src/core/linux/SDL_threadprio.c
Expand Up @@ -30,7 +30,7 @@
#include <pthread.h>
#include "SDL_system.h"

#if SDL_USE_LIBDBUS
#if HAVE_DBUS_DBUS_H
#include "SDL_dbus.h"
/* d-bus queries to org.freedesktop.RealtimeKit1. */
#define RTKIT_DBUS_NODE "org.freedesktop.RealtimeKit1"
Expand Down Expand Up @@ -88,14 +88,15 @@ SDL_LinuxSetThreadPriority(Sint64 threadID, int priority)
}

#if SDL_USE_LIBDBUS
/* Note that this fails if you're trying to set high priority
and you don't have root permission. BUT DON'T RUN AS ROOT!
You can grant the ability to increase thread priority by
running the following command on your application binary:
sudo setcap 'cap_sys_nice=eip' <application>
Let's try setting priority with RealtimeKit...
/* Note that this fails you most likely:
* Have your process's scheduler incorrectly configured.
See the requirements at:
http://git.0pointer.net/rtkit.git/tree/README#n16
* Encountered dbus/polkit security restrictions. Note
that the RealtimeKit1 dbus endpoint is inaccessible
over ssh connections for most common distro configs.
You might want to check your local config for details:
/usr/share/polkit-1/actions/org.freedesktop.RealtimeKit1.policy
README and sample code at: http://git.0pointer.net/rtkit.git
*/
Expand Down

0 comments on commit 84dc44e

Please sign in to comment.