HomeFreeBSD

trim(8): add another safety net

Description

trim(8): add another safety net

It is quite easy make a mistake and run something like this:

trim -f /dev/da0 -r rfile

This would trim the whole device then emit an error on non-existing file -r.

Add another check to prevent this while allowing this form still
for real object names beginning from dash:

trim -f -- /dev/da0 -r rfile

MFC after: 1 week

Details

Provenance
eugenAuthored on
Parents
rS345129: Revert zfsimpl.c accidentally committed in r345128
Branches
Unknown
Tags
Unknown