From c184d91d2ccf9947bd1a52482feeb3d247e0f808 Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Tue, 14 Jan 2014 19:20:16 +0200 Subject: [PATCH] SCHED_IDLE and SCHED_BATCH can only be used with sched_priority 0 The function was randomly failing to drop the priority, because the field was not initialized - it was random garbage instead of 0, leading to EINVAL. --- cpu-miner.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cpu-miner.c b/cpu-miner.c index c90391c..5d252ed 100644 --- a/cpu-miner.c +++ b/cpu-miner.c @@ -47,6 +47,7 @@ static inline void drop_policy(void) { struct sched_param param; + param.sched_priority = 0; #ifdef SCHED_IDLE if (unlikely(sched_setscheduler(0, SCHED_IDLE, ¶m) == -1))