Fix the RealtimeKit dbus include guards
authorSam Lantinga <slouken@libsdl.org>
Fri, 27 Sep 2019 15:21:27 -0700
changeset 130961b8c4b058c46
parent 13095 47cbedebfbd1
child 13097 101d088cc8fa
Fix the RealtimeKit dbus include guards

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.
Xcode/SDL/SDL.xcodeproj/project.pbxproj
src/core/linux/SDL_threadprio.c
     1.1 --- a/src/core/linux/SDL_threadprio.c	Thu Sep 26 13:44:49 2019 -0400
     1.2 +++ b/src/core/linux/SDL_threadprio.c	Fri Sep 27 15:21:27 2019 -0700
     1.3 @@ -30,7 +30,7 @@
     1.4  #include <pthread.h>
     1.5  #include "SDL_system.h"
     1.6  
     1.7 -#if SDL_USE_LIBDBUS
     1.8 +#if HAVE_DBUS_DBUS_H
     1.9  #include "SDL_dbus.h"
    1.10  /* d-bus queries to org.freedesktop.RealtimeKit1. */
    1.11  #define RTKIT_DBUS_NODE "org.freedesktop.RealtimeKit1"
    1.12 @@ -88,14 +88,15 @@
    1.13      }
    1.14  
    1.15  #if SDL_USE_LIBDBUS
    1.16 -    /* Note that this fails if you're trying to set high priority
    1.17 -       and you don't have root permission. BUT DON'T RUN AS ROOT!
    1.18 -
    1.19 -       You can grant the ability to increase thread priority by
    1.20 -       running the following command on your application binary:
    1.21 -          sudo setcap 'cap_sys_nice=eip' <application>
    1.22 -
    1.23 -       Let's try setting priority with RealtimeKit...
    1.24 +    /* Note that this fails you most likely:
    1.25 +         * Have your process's scheduler incorrectly configured.
    1.26 +           See the requirements at:
    1.27 +           http://git.0pointer.net/rtkit.git/tree/README#n16
    1.28 +         * Encountered dbus/polkit security restrictions. Note
    1.29 +           that the RealtimeKit1 dbus endpoint is inaccessible
    1.30 +           over ssh connections for most common distro configs.
    1.31 +           You might want to check your local config for details:
    1.32 +           /usr/share/polkit-1/actions/org.freedesktop.RealtimeKit1.policy
    1.33  
    1.34         README and sample code at: http://git.0pointer.net/rtkit.git
    1.35      */