]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tools/sched_ext: fix getopt not re-parsed on restart
authorDavid Carlier <devnexen@gmail.com>
Wed, 18 Feb 2026 19:22:35 +0000 (19:22 +0000)
committerTejun Heo <tj@kernel.org>
Sat, 21 Feb 2026 03:17:38 +0000 (17:17 -1000)
commit640c9dc72f21f325700a4b0f839ad568ff21c697
treefff0d9135f60b2fc5cf70b8763002d01ba697d39
parentf892f9f99464bead942a75d2b00dda6be07de97f
tools/sched_ext: fix getopt not re-parsed on restart

After goto restart, optind retains its advanced position from the
previous getopt loop, causing getopt() to immediately return -1.
This silently drops all command-line options on the restarted skeleton.

Reset optind to 1 at the restart label so options are re-parsed.

Affected schedulers: scx_simple, scx_central, scx_flatcg, scx_pair,
scx_sdt, scx_cpu0.

Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
tools/sched_ext/scx_central.c
tools/sched_ext/scx_cpu0.c
tools/sched_ext/scx_flatcg.c
tools/sched_ext/scx_pair.c
tools/sched_ext/scx_sdt.c
tools/sched_ext/scx_simple.c