Fix reverting to SCHED_OTHER

This still seemed to work, but the `sched_setscheduler` would return an
error code when the priority is set to 5 for SCHED_OTHER (which is of
course not a valid value here).
This commit is contained in:
Robbert van der Helm
2021-01-21 20:33:50 +01:00
parent 9b0324f4a7
commit e84f7425cf
+1 -1
View File
@@ -42,7 +42,7 @@ bool set_realtime_priority(bool sched_fifo) {
}
}
sched_param params{.sched_priority = 5};
sched_param params{.sched_priority = (sched_fifo ? 5 : 0)};
return sched_setscheduler(0, sched_fifo ? SCHED_FIFO : SCHED_OTHER,
&params) == 0;
}