Page MenuHomeFreeBSD

loader: ls command should display file types properly
ClosedPublic

Authored by tsoome on Mar 20 2017, 8:09 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 2, 7:58 PM
Unknown Object (File)
Thu, Oct 31, 3:24 PM
Unknown Object (File)
Thu, Oct 31, 3:23 PM
Unknown Object (File)
Thu, Oct 31, 3:23 PM
Unknown Object (File)
Thu, Oct 31, 3:23 PM
Unknown Object (File)
Thu, Oct 31, 3:22 PM
Unknown Object (File)
Thu, Oct 31, 3:22 PM
Unknown Object (File)
Thu, Oct 31, 3:21 PM
Subscribers
None

Details

Summary

With some file system the ls is unable to display file types.

Test Plan

verified zfs, ufs, nfs, dosfs

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 8340
Build 8607: arc lint + arc unit

Event Timeline

sys/boot/common/ls.c
120

sb is not used after this, until it is overwritten by the call to stat().

malloc can fail: so the stat size and mode should be zeroed before.
stat can fail: set mode = 0
and free does not need the check, but the comment is helpful.

tsoome added inline comments.
sys/boot/common/ls.c
120

something got missing in between... the size and mode need to be zeroed for case we do not get into the stat.

missed one more malloc check, and small cstyle fix - missing space after
return keyword.

And some more cstyle fixes.

still missed one space before tab.

This revision is now accepted and ready to land.Mar 28 2017, 9:35 PM
This revision was automatically updated to reflect the committed changes.