libct: simplify setIOPriority/setupScheduler calls

Move the nil check inside, simplifying the callers.

Fixes: bfbd0305 ("Add I/O priority")
Fixes: 770728e1 ("Support `process.scheduler`")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2024-06-26 16:14:44 -07:00
parent 2e906e292e
commit 2dc3ea4b87
4 changed files with 15 additions and 16 deletions
+3
View File
@@ -662,6 +662,9 @@ func setupRlimits(limits []configs.Rlimit, pid int) error {
}
func setupScheduler(config *configs.Config) error {
if config.Scheduler == nil {
return nil
}
attr, err := configs.ToSchedAttr(config.Scheduler)
if err != nil {
return err