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>
This commit is contained in:
Ruediger Meier 2016-10-26 19:46:22 +02:00
parent 0f2eb577ac
commit fded05ac81
1 changed files with 3 additions and 2 deletions

View File

@ -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);