[Toybox] [CLEANUP] stat

Felix Janda felix.janda at posteo.de
Sun May 26 01:38:44 PDT 2013


Hello,

some "cleanup" raising the SLOC...

The first patch makes stat support multiple files, fixes a format
string, inlines check_file_type() and adds functions do_stat()
do_statfs(), which do the system call and some preparations, to be
called via function pointers from main().

The second patch mainly inlines print_stat_format() splitting of
the big switch into print_stat() and print_statfs() to be called via
function pointers from main(). A nice side effect is that it now won't
segfault if you do something like "stat -f -c %B ."

For me this finishes the cleanup of stat.

Felix
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stat1.patch
Type: text/x-patch
Size: 4542 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20130526/33e2114e/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stat2.patch
Type: text/x-patch
Size: 9876 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20130526/33e2114e/attachment-0003.bin>


More information about the Toybox mailing list