mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
pipewire: thread: check sched_get_priority_*() return value
The function can report errors, so let's propagate them.
This commit is contained in:
parent
d17f68c047
commit
72f1719c95
1 changed files with 10 additions and 2 deletions
|
|
@ -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,
|
static int impl_get_rt_range(void *object, const struct spa_dict *props,
|
||||||
int *min, int *max)
|
int *min, int *max)
|
||||||
{
|
{
|
||||||
if (min)
|
if (min) {
|
||||||
*min = sched_get_priority_min(SCHED_OTHER);
|
*min = sched_get_priority_min(SCHED_OTHER);
|
||||||
if (max)
|
if (*min < 0)
|
||||||
|
return -errno;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (max) {
|
||||||
*max = sched_get_priority_max(SCHED_OTHER);
|
*max = sched_get_priority_max(SCHED_OTHER);
|
||||||
|
if (*max < 0)
|
||||||
|
return -errno;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
static int impl_acquire_rt(void *object, struct spa_thread *thread, int priority)
|
static int impl_acquire_rt(void *object, struct spa_thread *thread, int priority)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue