Commit 51817422fcaeb440fb06992e2ee18e2647d17e84

ckolivas 2011-06-14T14:09:10

Cope with older linux kernel headers that don't have the newer scheduling policies defined.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/cpu-miner.c b/cpu-miner.c
index 22b0962..374ffd8 100644
--- a/cpu-miner.c
+++ b/cpu-miner.c
@@ -40,8 +40,12 @@ static inline void drop_policy(void)
 {
 	struct sched_param param;
 
+#ifdef SCHED_IDLE
 	if (unlikely(sched_setscheduler(0, SCHED_IDLE, &param) == -1))
+#endif
+#ifdef SCHED_BATCH
 		sched_setscheduler(0, SCHED_BATCH, &param);
+#endif
 }
 
 static inline void affine_to_cpu(int id, int cpu)