do not attempt to use SCHED_IDLE when it is not available
Costa Tsaousis committed
Aug 23, 2016 at 14:14 UTC
d35d5857bb7436d3e07497cda5f49ecdd55401f3
1 file changed
+4
src/daemon.c
+4
@@ -139,6 +139,7 @@ void oom_score_adj(int score) {
139
}
140
141
int sched_setscheduler_idle(void) {
142
+#ifdef SCHED_IDLE
143
const struct sched_param param = {
144
.sched_priority = 0
145
};
@@ -150,6 +151,9 @@ int sched_setscheduler_idle(void) {
151
info("Adjusted my scheduling priority to IDLE.");
152
153
return i;
154
+#else
155
+ return -1;
156
+#endif
157
}
158
159
int become_daemon(int dont_fork, const char *user)