Browse Source

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.
Lauri Kasanen 12 years ago
parent
commit
525b02f3b3
2 changed files with 2 additions and 0 deletions
  1. 1 0
      AUTHORS
  2. 1 0
      driver-cpu.c

+ 1 - 0
AUTHORS

@@ -43,6 +43,7 @@ pontus <liquidpontus@yahoo.se>
 Tydus <Tydus@Tydus.org>
 Tydus <Tydus@Tydus.org>
 Raulo <p987341@gmail.com>
 Raulo <p987341@gmail.com>
 Kiyoaki Matsugae <matsugae.kiyoaki@gmail.com>
 Kiyoaki Matsugae <matsugae.kiyoaki@gmail.com>
+Lauri Kasanen <curaga@operamail.com>
 Thorsten Gilling <tgilling@web.de>
 Thorsten Gilling <tgilling@web.de>
 Isidoro Ghezzi <isidoro.ghezzi@icloud.com>
 Isidoro Ghezzi <isidoro.ghezzi@icloud.com>
 capa66 <capa66@x204.com>
 capa66 <capa66@x204.com>

+ 1 - 0
driver-cpu.c

@@ -49,6 +49,7 @@ BFG_REGISTER_DRIVER(cpu_drv)
 static inline void drop_policy(void)
 static inline void drop_policy(void)
 {
 {
 	struct sched_param param;
 	struct sched_param param;
+	param.sched_priority = 0;
 
 
 #ifdef SCHED_BATCH
 #ifdef SCHED_BATCH
 #ifdef SCHED_IDLE
 #ifdef SCHED_IDLE