]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
trim(8): emit more user-friendly error message in verbose mode.
authoreugen <eugen@FreeBSD.org>
Fri, 15 Mar 2019 14:42:23 +0000 (14:42 +0000)
committereugen <eugen@FreeBSD.org>
Fri, 15 Mar 2019 14:42:23 +0000 (14:42 +0000)
commited557b0b0ddf9a1bcc6c1465fe1648363cc18a3d
tree71c99bbc132ae596a5a80097b663ca28a5254f5f
parent329eef9d8458038f4ce694834e5a2ed704b38aa0
trim(8): emit more user-friendly error message in verbose mode.

If underlying driver provides no TRIM/UNMAP support and operation fails
due to this reason, state it clearly in verbose mode (default)
instead of writing standard message that may be too cryptic for a user:

trim: ioctl(DIOCGDELETE) failed: nda0: Operation not supported

Now it would write:

trim: nda0: TRIM/UNMAP not supported by driver

But still use previous format including errno value for quiet mode.

Small candelete() function borrowed from diskinfo(8) code.
This function was committed by Alan Somers <asomers@FreeBSD.org>,
so give him some credit.

Reported by: chuck
usr.sbin/trim/trim.c