From: Ruediger Meier Date: Wed, 26 Oct 2016 17:46:22 +0000 (+0200) Subject: chrt: fix HAVE_SCHED_SETATTR fallback case X-Git-Tag: v2.29~24^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fded05ac81d0225848eebe2ab1af96d23c30f4b2;p=thirdparty%2Futil-linux.git 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 --- diff --git a/schedutils/chrt.c b/schedutils/chrt.c index 0a51c1088c..a861d9f75a 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);