Bug 2989 - chrt applet: -m option is not working properly
Summary: chrt applet: -m option is not working properly
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC Linux
: P5 minor
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-18 21:20 UTC by Davide Viti
Modified: 2010-12-19 03:08 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Davide Viti 2010-12-18 21:20:04 UTC
if set, -m option should print minimum and maximum valid priorities, then exit

/ # chrt -m
BusyBox v1.19.0.git (2010-12-18 21:01:15 CET) multi-call binary.

Usage: chrt [-prfom] [PRIO] [PID | PROG ARGS]

Change scheduling priority and class for a process

Options:
	-p	Operate on PID
	-r	Set SCHED_RR class
	-f	Set SCHED_FIFO class
	-o	Set SCHED_OTHER class
	-m	Show min/max priorities

It prints the right ouput if an argument is passed to -m


/ # chrt -m foo
SCHED_FIFO min/max priority	: 1/99
SCHED_RR min/max priority	: 1/99
SCHED_OTHER min/max priority	: 0/0

I put some debugging printouts, and noticed that when -m is passed without argument, applet exits at getopt32() (at least does not get past it); I guess then there's something wrong with applet_opts ("+mprfo"), or with opt_complementary  ("-1:r--fo:f--ro:o--rf") or with getopt32()

regards,
Davide
Comment 1 Denys Vlasenko 2010-12-19 03:08:42 UTC
Thanks, fixed in git. Will be in 1.19.x