From 72f1719c957b3c92f122362b4c3ef76ae9ec3b08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Sun, 8 Jun 2025 23:38:58 +0200 Subject: [PATCH] pipewire: thread: check `sched_get_priority_*()` return value The function can report errors, so let's propagate them. --- src/pipewire/thread.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pipewire/thread.c b/src/pipewire/thread.c index 8bba05501..baca12212 100644 --- a/src/pipewire/thread.c +++ b/src/pipewire/thread.c @@ -131,10 +131,18 @@ static int impl_join(void *object, struct spa_thread *thread, void **retval) static int impl_get_rt_range(void *object, const struct spa_dict *props, int *min, int *max) { - if (min) + if (min) { *min = sched_get_priority_min(SCHED_OTHER); - if (max) + if (*min < 0) + return -errno; + } + + if (max) { *max = sched_get_priority_max(SCHED_OTHER); + if (*max < 0) + return -errno; + } + return 0; } static int impl_acquire_rt(void *object, struct spa_thread *thread, int priority)