Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Handle NULL return from SDL_DBus_GetContext()
- Loading branch information
Showing
with
2 additions
and
3 deletions.
-
+2
−3
src/thread/pthread/SDL_systhread.c
|
@@ -200,7 +200,7 @@ rtkit_initialize() |
|
|
SDL_DBusContext *dbus = SDL_DBus_GetContext(); |
|
|
|
|
|
/* Try getting minimum nice level: this is often greater than PRIO_MIN (-20). */ |
|
|
if (!SDL_DBus_QueryPropertyOnConnection(dbus->system_conn, RTKIT_DBUS_NODE, RTKIT_DBUS_PATH, RTKIT_DBUS_INTERFACE, "MinNiceLevel", |
|
|
if (!dbus || !SDL_DBus_QueryPropertyOnConnection(dbus->system_conn, RTKIT_DBUS_NODE, RTKIT_DBUS_PATH, RTKIT_DBUS_INTERFACE, "MinNiceLevel", |
|
|
DBUS_TYPE_INT32, &rtkit_min_nice_level)) { |
|
|
rtkit_min_nice_level = -20; |
|
|
} |
|
@@ -218,13 +218,12 @@ rtkit_setpriority(pid_t thread, int nice_level) |
|
|
if (si32 < rtkit_min_nice_level) |
|
|
si32 = rtkit_min_nice_level; |
|
|
|
|
|
if (!SDL_DBus_CallMethodOnConnection(dbus->system_conn, |
|
|
if (!dbus || !SDL_DBus_CallMethodOnConnection(dbus->system_conn, |
|
|
RTKIT_DBUS_NODE, RTKIT_DBUS_PATH, RTKIT_DBUS_INTERFACE, "MakeThreadHighPriority", |
|
|
DBUS_TYPE_UINT64, &ui64, DBUS_TYPE_INT32, &si32, DBUS_TYPE_INVALID, |
|
|
DBUS_TYPE_INVALID)) { |
|
|
return SDL_FALSE; |
|
|
} |
|
|
|
|
|
return SDL_TRUE; |
|
|
} |
|
|
|
|
|