blockdev applet proposal
Sergey Naumov
sknaumov at gmail.com
Mon Sep 6 14:19:27 UTC 2010
> Please review attached version.
All works fine except I can pass additional (3-rd) parameter at the
end of commands which do not require an argument,
for example ./busybox blockdev --rereadpt /dev/sda a.
It could save some size, but original utility accepts blockdev
--rereadpt /dev/sda /dev/sdb, so, from my point of view, we should
inform user when he tries to provide such an input.
So, I think, we should add
if (bdcmd->flags & FL_USRARG)
llu = xatoi_positive(*++argv);
+ else
+ if (argc > 3) bb_show_usage();
Very educational code, thanks =)
Sergey Naumov.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: blockdev.c
Type: application/octet-stream
Size: 3844 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20100906/ca149789/attachment.obj>
More information about the busybox
mailing list