summaryrefslogtreecommitdiffstats
path: root/schedutils
diff options
context:
space:
mode:
authorRuediger Meier2016-10-26 19:46:22 +0200
committerRuediger Meier2016-10-27 11:03:21 +0200
commitfded05ac81d0225848eebe2ab1af96d23c30f4b2 (patch)
treea0af58bd68401b03a8d13193ce78caa90b8c92e9 /schedutils
parentfdisk: fix memleak in list_disk_geometry() (diff)
downloadkernel-qcow2-util-linux-fded05ac81d0225848eebe2ab1af96d23c30f4b2.tar.gz
kernel-qcow2-util-linux-fded05ac81d0225848eebe2ab1af96d23c30f4b2.tar.xz
kernel-qcow2-util-linux-fded05ac81d0225848eebe2ab1af96d23c30f4b2.zip
chrt: fix HAVE_SCHED_SETATTR fallback case
Broken since 6f27e449. We could not enter the fallback if HAVE_SCHED_SETATTR is not defined. Two gcc warnings made this issue visible: schedutils/chrt.c:247:1: warning: label 'fallback' defined but not used [-Wunused-label] schedutils/chrt.c:266:9: warning: 'policy' may be used uninitialized in this function [-Wuninitialized] Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'schedutils')
-rw-r--r--schedutils/chrt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/schedutils/chrt.c b/schedutils/chrt.c
index 0a51c1088..a861d9f75 100644
--- a/schedutils/chrt.c
+++ b/schedutils/chrt.c
@@ -239,13 +239,14 @@ static void show_sched_pid_info(struct chrt_ctl *ctl, pid_t pid)
runtime = sa.sched_runtime;
period = sa.sched_period;
}
-#endif
/*
* Old way
*/
fallback:
- if (errno == ENOSYS) {
+ if (errno == ENOSYS)
+#endif
+ {
struct sched_param sp;
policy = sched_getscheduler(pid);