growfs: make exit codes more consistent
authorMina Galić <freebsd@igalic.co>
Thu, 5 Oct 2023 18:24:53 +0000 (20:24 +0200)
committerDag-Erling Smørgrav <des@FreeBSD.org>
Fri, 6 Oct 2023 13:02:40 +0000 (15:02 +0200)
commit70a0fb43f91cfe3d08db7cb443d9690f8bff065e
treec674ad59ba5dc3fdee5bb8f277c338e0738e432e
parent299e2d5724c2bc4929b6eac3258f04055e97992e
growfs: make exit codes more consistent

We have overused err(1), so it's hard to distinguish when an error is
very, very serious, and when it's just a user-error, or even harmless.

This patch changes the current behaviour to distinguish between the
following three:

1 for usage errors
2 for recoverable errors
3 or higher for unrecoverable errors

Reviewed by: jilles, pauamma_gundo.com, des
Differential Revision: https://reviews.freebsd.org/D27161
sbin/growfs/growfs.8
sbin/growfs/growfs.c