diff --git a/src/start-stop-daemon/start-stop-daemon.c b/src/start-stop-daemon/start-stop-daemon.c index 3e4a19a19..f7fcfee63 100644 --- a/src/start-stop-daemon/start-stop-daemon.c +++ b/src/start-stop-daemon/start-stop-daemon.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -1123,7 +1124,7 @@ int main(int argc, char **argv) if (sched_prio == -1) sched.sched_priority = sched_get_priority_min(scheduler_index); - if (sched_setscheduler(mypid, scheduler_index, &sched)) + if (pthread_setschedparam(pthread_self(), scheduler_index, &sched)) eerrorx("Failed to set scheduler: %s", strerror(errno)); } else if (sched_prio != -1) { const struct sched_param sched = {.sched_priority = sched_prio};