Bug 2989

Summary: chrt applet: -m option is not working properly
Product: Busybox Reporter: Davide Viti <zinosat>
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: minor CC: busybox-cvs
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:

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