[1.2.x] hdparm -S argument parsing broken

Andre armcc2000 at yahoo.com
Wed Aug 2 09:57:38 UTC 2006


Tito <farmatito at tiscali.it> wrote:
> On Wednesday 2 August 2006 03:02, Andre wrote:
> > Somewhere between 1.1.3 and 1.2.0, hdparm argument parsing seems
> > to have got broken:
> > 
> > # busybox
> > BusyBox v1.2.1 (2006.08.01-11:01+0000) multi-call binary
> > 
> > # busybox hdparm -S 180 /dev/hda
> > hdparm: 180: No such file or directory
> > 
> 
> this is due to the fact that hdparm was ported to getopt for
> command line parsing. Now if an argument of a command line
> switch is optional it must follow its switch with no blank
> space between them:
> 

Thanks for the hint !!

hdparm -S with no arguments doesn't do anything useful with busybox
and generates a 'missing value' warning with hdparm from debian
sarge... so this certainly looks like a bug.

Also noticed that print_flag() does the wrong thing for 'set_standby'
- it prints value followed by a newline instead of value followed by
opening bracket.

# hdparm -S 180 /dev/hda

/dev/hda:
 setting standby to 180 (15 minutes)

# busybox hdparm -S180 /dev/hda

/dev/hda:
 setting standby to 180
15 minutes + 0 seconds)          <-- should be on previous line


Andre
--



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the busybox mailing list