pipewire: thread: check sched_get_priority_*() return value

The function can report errors, so let's propagate them.
This commit is contained in:
Barnabás Pőcze 2025-06-08 23:38:58 +02:00 committed by Wim Taymans
parent d17f68c047
commit 72f1719c95

View file

@ -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)