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)
Mon, Jun 24, 1:24 AM
Unknown Object (File)
Sat, Jun 22, 3:23 PM
Unknown Object (File)
Wed, May 29, 1:46 AM
Unknown Object (File)
Apr 7 2024, 4:30 PM
Unknown Object (File)
Apr 4 2024, 11:10 PM
Unknown Object (File)
Jan 3 2024, 2:41 AM
Unknown Object (File)
Dec 20 2023, 2:13 AM
Unknown Object (File)
Nov 30 2023, 11:39 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 Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/boot/common/ls.c
120 โ†—(On Diff #26466)

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 โ†—(On Diff #26466)

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.