]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
chrt: default to SCHED_RR policy
authorAndreas Henriksson <andreas@fatal.se>
Fri, 2 Dec 2016 14:10:18 +0000 (15:10 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 5 Dec 2016 12:07:50 +0000 (13:07 +0100)
This fixes a regression introduced in:

commit 7a4ea5664edba98bff28adec3a9c3cfb5763a495
"chrt: add control struct"

Previously (and as documented in the manpage) the default policy
was SCHED_RR. Now it's implicitly SCHED_OTHER (0) as the value
is not initialized explicitly anymore.

Test-command: chrt 90 echo hello

Reported-by: Patrick Pelissier <patrick.pelissier@gmail.com>
Addresses: http://bugs.debian.org/846572
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
schedutils/chrt.c

index a861d9f75a52740626fb3b607cf05ed2f1ed80e0..73d1ffa9b49f41c7f26a510c4569a4b2c92b5b2b 100644 (file)
@@ -409,7 +409,7 @@ static void set_sched(struct chrt_ctl *ctl)
 
 int main(int argc, char **argv)
 {
-       struct chrt_ctl _ctl = { .pid = -1 }, *ctl = &_ctl;
+       struct chrt_ctl _ctl = { .pid = -1, .policy = SCHED_RR }, *ctl = &_ctl;
        int c;
 
        static const struct option longopts[] = {