[Differential] D27161: growfs: use sysexits in place of err/errc/errx(1)
me_igalic.co (Mina Galić)
phabric-noreply at FreeBSD.org
Fri Nov 20 11:58:06 UTC 2020
me_igalic.co added a comment.
In D27161#609617 <https://reviews.freebsd.org/D27161#609617>, @jilles wrote:
> My suggestion is to change all the exit statuses that were changed to sysexits codes here to 2 instead.
>
> "requested size %s is not larger than the current filesystem size %s" remains at 1 so that it can be checked for.
>
> This results in a pattern much like grep(1) and test(1): the exit status is 0 if the file system has been or would be (with `-N`) enlarged, 1 if the file system is already at its maximum size and >1 if an error occurred. In practice, the ">1" is always 2, but this allows future expansion; scripts should check for the value 1, not for the value 2.
i can see one other class of error: recoverable error, caused by bogus input. the wrong size, unrecognised extension used on the size,
or heck even, wrong partition (or inability to find the correct device, or supplying a non-UFS.
all of these are recoverable, by correcting the input. however, they are not recoverable in scripts, as they are mostly human errors
OS errors, OTOH, are almost never recoverable without a major operation (running out of RAM or space, etc etc)
> Please add this to the man page as well.
that's the plan. as soon as we have something solid.
I'd also like to continue this work in other tools that you find need it
REPOSITORY
rS FreeBSD src repository
CHANGES SINCE LAST ACTION
https://reviews.freebsd.org/D27161/new/
REVISION DETAIL
https://reviews.freebsd.org/D27161
EMAIL PREFERENCES
https://reviews.freebsd.org/settings/panel/emailpreferences/
To: me_igalic.co, oshogbo
Cc: oshogbo, jilles, 0mp, imp, #contributor_reviews_base, dev-reviews
More information about the dev-reviews
mailing list