dcavalca / rpms / util-linux

Forked from rpms/util-linux 2 years ago
Clone
1fb9fb
From 7c9a240af89ba8025ee86e7ec1ab22708924fc4b Mon Sep 17 00:00:00 2001
1fb9fb
From: Andreas Henriksson <andreas@fatal.se>
1fb9fb
Date: Fri, 2 Dec 2016 15:10:18 +0100
1fb9fb
Subject: [PATCH 200/201] chrt: default to SCHED_RR policy
1fb9fb
1fb9fb
This fixes a regression introduced in:
1fb9fb
1fb9fb
commit 7a4ea5664edba98bff28adec3a9c3cfb5763a495
1fb9fb
"chrt: add control struct"
1fb9fb
1fb9fb
Previously (and as documented in the manpage) the default policy
1fb9fb
was SCHED_RR. Now it's implicitly SCHED_OTHER (0) as the value
1fb9fb
is not initialized explicitly anymore.
1fb9fb
1fb9fb
Test-command: chrt 90 echo hello
1fb9fb
1fb9fb
Reported-by: Patrick Pelissier <patrick.pelissier@gmail.com>
1fb9fb
Addresses: http://bugs.debian.org/846572
1fb9fb
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1905954
1fb9fb
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
1fb9fb
---
1fb9fb
 schedutils/chrt.c | 2 +-
1fb9fb
 1 file changed, 1 insertion(+), 1 deletion(-)
1fb9fb
1fb9fb
diff --git a/schedutils/chrt.c b/schedutils/chrt.c
1fb9fb
index 0a51c1088..4cceff2d7 100644
1fb9fb
--- a/schedutils/chrt.c
1fb9fb
+++ b/schedutils/chrt.c
1fb9fb
@@ -408,7 +408,7 @@ static void set_sched(struct chrt_ctl *ctl)
1fb9fb
 
1fb9fb
 int main(int argc, char **argv)
1fb9fb
 {
1fb9fb
-	struct chrt_ctl _ctl = { .pid = -1 }, *ctl = &_ctl;
1fb9fb
+	struct chrt_ctl _ctl = { .pid = -1, .policy = SCHED_RR }, *ctl = &_ctl;
1fb9fb
 	int c;
1fb9fb
 
1fb9fb
 	static const struct option longopts[] = {
1fb9fb
-- 
1fb9fb
2.28.0
1fb9fb